svn commit: r292120 - in head/contrib/elftoolchain: addr2line common elfcopy libelf readelf

Benjamin Kaduk bjkfbsd at gmail.com
Sun Dec 13 18:58:13 UTC 2015


On Sun, Dec 13, 2015 at 3:13 AM, Dimitry Andric <dim at freebsd.org> wrote:

> On 13 Dec 2015, at 09:43, Kai Wang <kaiw27 at gmail.com> wrote:
> >
> > 2015-12-13 7:04 GMT+01:00 Adrian Chadd <adrian.chadd at gmail.com>:
> > cc1: warnings being treated as errors
> >
> /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:
> > In function 'dump_dwarf':
> >
> /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:7479:
> > warning: 'b' may be used uninitialized in this function
> >
> /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:7479:
> > note: 'b' was declared here
> >
> /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:4758:
> > warning: 'pe' may be used uninitialized in this function
> >
> /usr/home/adrian/work/freebsd/head-embedded/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:4758:
> > note: 'pe' was declared here
> >
> > .. these both seem like legit.
> >
> >
> > Hi,
> >
> > Sorry about the breakage. Should be fixed by r292158.
> > Somehow clang didn't catch this. Had to use gcc to see this warning.
>
> Indeed, this is interesting.  For clang to warn similarly, the
> -Wconditional-uninitialized option has to be enabled explicitly, and
> then you get a lot of them (this is from just before your commit):
>
> /usr/src/usr.bin/readelf/../../contrib/elftoolchain/readelf/readelf.c:4861:33:
> error: variable 'pe' may be uninitialized when used here
> [-Werror,-Wconditional-uninitialized]
>                         dirndx = _decode_uleb128(&p, pe);
> [...]
> I'll check if there is a specific reason upstream does not enable this
> warning by default for -Wall.  Maybe there is a risk of false positives.
>
> -Dimitry
>
>
I'm pretty sure I've seen lots of false positives from
-Wconditional-uninitialized in the krb5 and openafs codebases.  I either
set -Wno-error=conditional-uninitialized or -Wno-conditional-uninitialized
depending on how distracting they are in my build logs.

-Ben


More information about the svn-src-head mailing list