[PATCH] [StaticAnalyzer] New checker StringPlusChar

Jordan Rose jordan_rose at apple.com
Thu Sep 19 09:23:29 PDT 2013


I could have sworn we had a check or warning for this already, but I don't see it. Hopefully I'll get a chance to review this soon; thanks, Anders!

Jordan


On Sep 19, 2013, at 7:46 , Anders Rönnholm <Anders.Ronnholm at evidente.se> wrote:

> Hi,
> 
> This is a new check i want to get reviewed. It checks for char literal additions on strings.
> 
> Example:
> char* str;
> str = str + 'c';
> 
> This is a suspicious pointer arithmetic, probably string addition was intended.
> 
> Thanks,
> Anders
> 
> .......................................................................................................................
> Anders Rönnholm Senior Engineer
> Evidente ES East AB  Warfvinges väg 34  SE-112 51 Stockholm  Sweden
> 
> Mobile:                    +46 (0)70 912 42 54
> E-mail:                    Anders.Ronnholm at evidente.se
> 
> www.evidente.se
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stringpluschar.diff
Type: text/x-patch
Size: 5799 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130919/813ea789/attachment.bin>
-------------- next part --------------
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits



More information about the cfe-commits mailing list