Skip to content
Commit 5565941e authored by Jordan Rose's avatar Jordan Rose
Browse files

Add -Wstring-plus-char, which warns when adding char literals to C strings.

Specifically, this warns when a character literal is added (using '+') to a
variable with type 'char *' (or any other pointer to character type). Like
-Wstring-plus-int, there is a fix-it to change "foo + 'a'" to "&foo['a']"
iff the character literal is on the right side of the string.

Patch by Anders Rönnholm!

llvm-svn: 193418
parent c0fdb394
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment