[PATCH] [StaticAnalyzer] New checker StringPlusChar

Anders Rönnholm Anders.Ronnholm at evidente.se
Thu Oct 24 23:27:08 PDT 2013


Hi,

New iteration where char16_t is taken care of.

//Anders

________________________________________
Från: Jordan Rose [jordan_rose at apple.com]
Skickat: den 22 oktober 2013 21:08
Till: Daniel Marjamäki
Cc: Richard Smith; Anders Rönnholm; cfe commits
Ämne: Re: [PATCH] [StaticAnalyzer] New checker StringPlusChar

On Oct 21, 2013, at 22:39 , Daniel Marjamäki <Daniel.Marjamaki at evidente.se> wrote:

>
> Hello!
>
> There was a thread about the new checker StringPlusChar:
> http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130930/thread.html#89826
>
> I wonder what we need to do to make you happy?
>
> My last response is here:
> http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131007/090324.html
>
> About this:
>> The idea and the patch both seem good to me, other than the diagnostic wording. Perhaps something like:
>>  adding %0 to %1 does not append to the string
>
> The latest patch from Anders fixes this, it writes such messages:
>
>  char *str = 0;
>  char *str2 = str + 'c'; // expected-warning {{adding 'char' to a string pointer does not append to the string}} expected-note {{use array indexing to silence this warning}}


I'm sorry, this still doesn't include the type:

// clang++ -fsyntax-only -std=c++11
char *str = 0;
char *str2 = str + u'a'; // expected-warning {{adding 'char16_t' to a string pointer does not append to the string}}

Jordan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stringpluschar.diff
Type: text/x-patch
Size: 7098 bytes
Desc: stringpluschar.diff
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131025/8fbb73ef/attachment.bin>


More information about the cfe-commits mailing list