On 06/11/2017 07:26 PM, Xi Ruoyao wrote:
Hi,
I've implemented -Wstring-plus-int and -Wstring-plus-char (like their
counterpart in Clang) for GCC.
From the Clang patch(*) it only "warns when a character literal is
added (using '+') to a variable with type 'char *' (or any other
pointer to character type).
Based on the tests in this patch, GCC will warn for non-literal
operands as well. Is that intentional, and if so, what is your
rationale for the difference?
Martin
[*]
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20131021/091671.html