[PATCH] [StaticAnalyzer] New checker StringPlusChar

Jordan Rose jordan_rose at apple.com
Wed Oct 2 09:12:09 PDT 2013


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

> 
> Hello!
> 
>> This should be a warning, not a static analyser check, shouldn't it?
> 
> Is anybody against this?
> 
> Personally I feel very confident about this check regarding signal/noise. However putting it in the static analyser to start with felt like a safe choice.

I'm fine with this. I didn't realize at first it was just for character literals; with that restriction this does seem like false positives would be unlikely. Thanks, Richard. (Sorry to force another iteration, Anders. The existing warning is in SemaExpr.cpp: diagnoseStringPlusInt.)

Daniel, delaying += and char plus string seem fine to me, though they might just be handled if you hook into diagnoseStringPlusInt. And thanks for the reminder about things like s8, u8, etc.

Jordan



More information about the cfe-commits mailing list