On Mon, Jul 12, 2010 at 07:04:11PM +0200, ext Eamon Walsh wrote:
> On 07/05/2010 09:21 AM, Vignatti Tiago (Nokia-MS/Helsinki) wrote:
> >
> > So I disabled XACE here in my machine and now my static analyzer is accusing
> > ~100 pieces of deadcode. That's because we have XaceHook everywhere and,
> > when
> > disabling the extension, this function will always return Success which
> > makes
> > the subsequent "if (rc != Success)" useless.
> >
> > I took a look on the code and couldn't find a way to put this conditional
> > inside the XaceHook, when the extension is being used. Do you think there's
> > an
> > easy way to do so? Do we really need to always check for value or this is
> > just
> > a safety check? Or do you have an better idea?
>
> When XACE is disabled, XaceHook turns into a macro for Success, not a
> function call that returns Success. The compiler should optimize out
> all the dead code. This seems like a pretty common idiom to me. I
> don't think the static analyzer should warn on stuff like this.
All right, that's true. I noticed now the compiler optimizing out this hunk.
Thanks,
Tiago
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel