On Wed, Apr 25, 2012 at 04:07:29PM +0200, Sumit Bose wrote:
On Wed, Apr 25, 2012 at 03:28:20PM +0200, Stef Walter wrote:
> On 04/24/2012 12:42 PM, Sumit Bose wrote:
> > Chances are that some static code analysis tools or -D_FORTIFY_SOURCE=2
> > might complain about an unchecked return value. Currently we mostly try
> > to make those tools happy, even if the code becomes a bit redundant.
> >
> > Have you checked if -D_FORTIFY_SOURCE=2 gives an extra warning here?
>
> Do I just define that macro? ie:
>
> $ CFLAGS='-g -O0 -D_FORTIFY_SOURCE=2' ./configure ...
yes, this is ok. Typically it is used as -Wp,-D_FORTIFY_SOURCE=2, but
your usage would work as well.
>
> If that's the case, then no, no additional warnings were generated.
ok, thank you for testing.
bye,
Sumit
I also tested that clang's scan-build does not emit any new warning with
the patch -- it doesn't. It *did* print a handful of warnings in the
existing code, so I'm looking into them to sort out the real bugs from
the false positives.
I'm also attaching the patch Stef attached to the ticket. I don't have
any more comments, so Ack from me.