clang static analysis

Jeremy Huddleston jeremyhu at apple.com
Sat May 22 09:16:48 PDT 2010


On May 21, 2010, at 22:18, Jamey Sharp wrote:

> On Fri, May 21, 2010 at 11:19 AM, Jeremy Huddleston <jeremyhu at apple.com> wrote:
>> The analyzer is correct.  It sees the call to miFillPolyHelper on line
>> 1849 and assumes that pGC can change because it is not const ...
>> 
>> My guess is that applying "const" correctly in many places will help
>> the SA avoid false positives like this.
> 
> Ooh, interesting. OK. miFillPolyHelper can't take a const pGC though,
> because eventually it passes it to ChangeGC (although with the invariant
> that it will be changed back before returning).

I think in this case, miFillPolyHelper should take a const pGC and pass it casted to non-const to ChangeGC (since it knows it will be preserved by another handshaking method).




More information about the xorg-devel mailing list