diff options
author | Martin Sebor <msebor@redhat.com> | 2017-12-06 17:51:21 +0000 |
---|---|---|
committer | Martin Sebor <msebor@gcc.gnu.org> | 2017-12-06 10:51:21 -0700 |
commit | 8a797929f09274ccbf95ee7d8e415d35c1f5b0d1 (patch) | |
tree | f8db0e3585f9240aaa70bc7bbdb52d1f6754bf84 /gcc | |
parent | 25b15e953ac48e5042e27a4419ca20211403b7cb (diff) | |
download | gcc-8a797929f09274ccbf95ee7d8e415d35c1f5b0d1.zip gcc-8a797929f09274ccbf95ee7d8e415d35c1f5b0d1.tar.gz gcc-8a797929f09274ccbf95ee7d8e415d35c1f5b0d1.tar.bz2 |
invoke.texi (-Wstringop-truncation): Mention attribute nonstring.
gcc/ChangeLog:
* doc/invoke.texi (-Wstringop-truncation): Mention attribute
nonstring.
From-SVN: r255447
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/doc/invoke.texi | 8 |
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5bcc6a9..1615acf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ 2017-12-06 Martin Sebor <msebor@redhat.com> + * doc/invoke.texi (-Wstringop-truncation): Mention attribute + nonstring. + PR tree-optimization/83075 * tree-ssa-strlen.c (handle_builtin_stxncpy): Avoid assuming strncat/strncpy don't change length of source string. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index b8c8083..3487a62 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -5256,6 +5256,14 @@ void copy (const char *s) @} @end smallexample +In situations where a character array is intended to store a sequence +of bytes with no terminating @code{NUL} such an array may be annotated +with attribute @code{nonstring} to avoid this warning. Such arrays, +however, are not suitable arguments to functions that expect +@code{NUL}-terminated strings. To help detect accidental misuses of +such arrays GCC issues warnings unless it can prove that the use is +safe. @xref{Common Variable Attributes}. + @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{|}cold@r{|}malloc@r{]} @opindex Wsuggest-attribute= @opindex Wno-suggest-attribute= |