<div class="gmail_quote">On Thu, Jul 5, 2012 at 7:14 AM, Joerg Sonnenberger <span dir="ltr"><<a href="mailto:joerg@britannica.bec.de" target="_blank">joerg@britannica.bec.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Tue, Jul 03, 2012 at 12:37:44PM -0700, Richard Smith wrote:<br>
> On Tue, Jul 3, 2012 at 1:14 AM, Joerg Sonnenberger<br>
> <<a href="mailto:joerg@britannica.bec.de">joerg@britannica.bec.de</a>>wrote:<br>
><br>
> > On Mon, Jul 02, 2012 at 11:23:05PM -0000, Richard Smith wrote:<br>
> > > Log:<br>
> > > -Wuninitialized: assume that an __attribute__((returns_twice)) function<br>
> > might<br>
> > > initialize any variable. This is extremely conservative, but is<br>
> > sufficient for<br>
> > > now.<br>
> ><br>
> > Can this be reduced to following both code paths if the function call is<br>
> > part of a conditional?<br>
><br>
><br>
> I'm not sure what you're suggesting; we do follow both code paths after a<br>
> conditional. If you mean that we should track whether the function returned<br>
> a nonzero value, and not apply this logic in that case, then I think that's<br>
> out of scope for this check, and belongs in the static analyzer (if<br>
> anywhere).<br>
<br>
</div>Consider the attached test case. I think we definitely want to warn<br>
here.</blockquote><div><br></div><div>With the approach I suggested, we would do so (although for more complex cases, we would not). Are you suggesting that we should somehow track whether there exists any variable which is used uninitialized irrespective of the return value of setjmp? That sounds like a correct criterion, so if you have a suggestion for a way to implement it efficiently, that would be interesting.</div>
</div>