On Wed, 22 Feb 2017, Xi Ruoyao wrote:
> 2017-02-22 Xi Ruoyao <[email protected]>
>
> * doc/invoke.texi (Warning Options): Document -Wstring-plus-int
In principle this looks fine, but...
> +@item -Wstring-plus-int
> +@opindex Wstring-plus-int
> +@opindex Wno-string-plus-int
> +Warn for adding an integer to a string pointer or string literal,
> +which seems an ill-formed attempt to append to the string.
...I will say this may not give people too much of an idea of what
it is about.
I.e., after reading the above, I was wondering who'd do "abc" + 1.
Of course, once I looked at your good additions to the testsuite,
I realized that this is really more about "abc" + '1'. Technically
the description is correct, since character constants are integers.
Perhaps add something like
"A typical example this warns about is @samp{"abc" + 'd'}."
?
Gerald