diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 5d41649..4859341 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -311,7 +311,7 @@ Objective-C and Objective-C++ Dialects}. -Wsizeof-pointer-memaccess -Wsizeof-array-argument @gol -Wstack-protector -Wstack-usage=@var{len} -Wstrict-aliasing @gol -Wstrict-aliasing=n -Wstrict-overflow -Wstrict-overflow=@var{n} @gol --Wstringop-overflow=@var{n} @gol +-Wstringop-overflow=@var{n} @gol -Wstring-plus-char -Wstring-plus-int -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]} @gol -Wsuggest-final-types @gol -Wsuggest-final-methods -Wsuggest-override @gol -Wmissing-format-attribute -Wsubobject-linkage @gol @@ -5125,6 +5125,26 @@ whether to issue a warning. Similarly to @option{-Wstringop-overflow=3} this setting of the option may result in warnings for benign code. @end table +@item -Wstring-plus-char +@opindex Wstring-plus-char +@opindex Wno-string-plus-char +Warn for adding a character to a string pointer, which seems like a failed +attempt to append to the string. For example, this option will issue a +warning for the code below. + +@smallexample +const char *p = "abc", *q; +q = p + 'a'; +@end smallexample + +@item -Wstring-plus-int +@opindex Wstring-plus-int +@opindex Wno-string-plus-int +Warn for adding an integer to a string literal, which may forms a pointer +out of the bound of the string. The typical examples this warns about are +@samp{"abc" + 'd'}, @samp{"abc" + getchar()} and @samp{"abc" + 5}, but +not @samp{"abc" + 1}. + @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]} @opindex Wsuggest-attribute= @opindex Wno-suggest-attribute= -- 2.7.1