[PATCH] [StaticAnalyzer] New checker Sizeof on expression

Joerg Sonnenberger joerg at britannica.bec.de
Wed Sep 25 22:43:01 PDT 2013

On Fri, Sep 20, 2013 at 08:23:39AM +0000, Anders Rönnholm wrote:
> I have another checker i would like to get reviewed. It checks for
> usage of sizeof on an expression. For now it only checks binary
> operators. Sizeof on defines does not generate a warning.
> Example:
> sizeof(2 + 1);

I would make one exception here to not report if the result is compared
against another sizeof. That's the one reasonable use of sizeof with an
expression I can think of.


More information about the cfe-commits mailing list