This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/2] libdw: ensure read_encoded_value's value is set


On Thu, 2015-02-12 at 00:22 +0100, Petr Machata wrote:
> Josh Stone <jistone@redhat.com> writes:
> 
> > With CFLAGS='-Og -g', F21 gcc hits -Werror=maybe-uninitialized in
> > read_encoded_value at "*result += value".  It's fine with -O2/-O0.
> >
> > By my inspection, the only way those don't set value are for error
> > cases, which will then return immediately.
> 
> Looks good to me.  I don't see how we could end up using value
> uninitialized either, but oh well.

Agreed. In general I don't like working around limitations in the
compiler not correctly deducing things like this. Especially since it
does seem to figure things out fine with -O0/-O2. But in both this case
and the test case the explicit initialization seems harmless/not on a
critical path. And it is nice to have -Og work for those that want to
use it.

Thanks,

Mark

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]