gdb fails to compile with GCC 4.4.7 (was: [PATCH V4 5/9] New probe type: DTrace USDT probes.)

Joel Brobecker brobecker@adacore.com
Fri Mar 27 13:42:00 GMT 2015


> I think this patch (commit 429e1e811b400f07b5a514ea6b8a70b28e2d7ee9) causes
> gdb's compilation to fail with GCC 4.4.7 (RHEL 6 system compiler) as follows;
> it does work with GCC 5.
> 
> cc1: warnings being treated as errors
> ../../gdb/dtrace-probe.c: In function ‘dtrace_process_dof_probe’:
> ../../gdb/dtrace-probe.c:416: error: ‘expr’ may be used uninitialized in this function
> make[2]: *** [dtrace-probe.o] Error 1
> 
> 
> I think that looks spurious as the code looks fine (i.e. GCC is overzaelous), still,
> a "= NULL" should harm.

Would you mind checking that the attached patch fixes the problem?

gdb/ChangeLog:

        * dtrace-probe.c (dtrace_process_dof_probe): Initialize expr to NULL.

Tested on x86_64-linux by rebuilding GDB.

Thank you,
-- 
Joel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Initialize-EXPR-in-dtrace-probe-dtrace_process_dof_p.patch
Type: text/x-diff
Size: 1396 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20150327/cd9d134a/attachment.bin>


More information about the Gdb-patches mailing list