[PATCH] [StaticAnalyzer] New checker StringPlusChar

Daniel Marjamäki Daniel.Marjamaki at evidente.se
Mon Oct 21 22:39:43 PDT 2013


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}}

Best regards,
Daniel Marjamäki



..................................................................................................................
Daniel Marjamäki Senior Engineer
Evidente ES East AB  Warfvinges väg 34  SE-112 51 Stockholm  Sweden

Mobile:                 +46 (0)709 12 42 62
E-mail:                 Daniel.Marjamaki at evidente.se

www.evidente.se

________________________________________
Från: cfe-commits-bounces at cs.uiuc.edu [cfe-commits-bounces at cs.uiuc.edu] för Daniel Marjamäki [Daniel.Marjamaki at evidente.se]
Skickat: den 7 oktober 2013 11:41
Till: Richard Smith; Jordan Rose
Cc: Anders Rönnholm; cfe commits
Ämne: Re: [PATCH] [StaticAnalyzer] New checker StringPlusChar

Hello!

Thank you for the rapid response.

> I think the check makes some sense. If I have

Yes I agree.

> The idea and the patch both seem good to me, other than the diagnostic wording. Perhaps something like:

Yes your suggestion sounds good.

> I wonder whether we want to catch more than just DeclRefExprs on the pointer side.

Yes.

However in the first patch I'd prefer if we only catch plain pointers. I hope this is ok for you.

There are a few improvements we can make in this checking later.. when the first patch is accepted.

Best regards,
Daniel Marjamäki

..................................................................................................................
Daniel Marjamäki Senior Engineer
Evidente ES East AB  Warfvinges väg 34  SE-112 51 Stockholm  Sweden

Mobile:                 +46 (0)709 12 42 62
E-mail:                 Daniel.Marjamaki at evidente.se

www.evidente.se

_______________________________________________
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