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/doc | |
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/doc')
-rw-r--r-- | gcc/doc/invoke.texi | 8 |
1 files changed, 8 insertions, 0 deletions
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= |