[Ltrace-devel] ERROR: 'entry.a_un.a_val' may be used uninitialized in this function [-Werror=maybe-uninitialized]

Sedat Dilek sedat.dilek at gmail.com
Thu Nov 8 18:18:05 UTC 2012


On Thu, Nov 8, 2012 at 7:01 PM, Petr Machata <pmachata at redhat.com> wrote:
> Sedat Dilek <sedat.dilek at gmail.com> writes:
>
>> On Fri, Nov 2, 2012 at 5:45 PM, Sedat Dilek <sedat.dilek at gmail.com> wrote:
>>> From my build-log...
>>> [...]
>>> proc.c  -fPIC -DPIC -o .libs/proc.o
>>> proc.c: In function 'process_get_entry':
>>> proc.c:674:28: error: 'entry.a_un.a_val' may be used uninitialized in
>>
>> Anyone has a fix for this issue?
>> With modern gcc-versions (here I use gcc-4.7.2-RC) this warning is
>> treated as an error (see also gcc-manual chapter "3.8 Options to
>
> Sorry, I forgot about this one.
>
> The warning is treated as error because we build with -Werror.
>

I know... This build-flag lets us catch more warnings/errors.

> I tried to build ltrace on Fedora 17 and Fedora 18 (both have GCC
> 4.7.2), and I'm not getting this warning.  It also seems invalid to me,
> "entry" should be initialized properly in the fetch_auxv{32,64}_entry.
> Perhaps there was a related bugfix between RC and final?  Perhaps
> consider updating to final.
>

I kept my toolchain and didn't wanted to change or upgrade it
(toolchain is complex enough and could be new place for
misbehaviour/errors).

> I put in an explicit initialization (though it should be entirely
> unnecessary), hopefully this will make the warning go away.
>

Cool. Thanks for the fix.

- Sedat -

> Thanks,
> PM



More information about the Ltrace-devel mailing list