Initialize EXPR in dtrace-probe::dtrace_process_dof_probe
GCC 4.4.7 generates the following warning: | cc1: warnings being treated as errors | dtrace-probe.c: In function ‘dtrace_process_dof_probe’: | dtrace-probe.c:416: error: ‘expr’ may be used uninitialized in this function | make[2]: *** [dtrace-probe.o] Error 1 Later versions (GCC 5) do a better job and don't generate the warning, but it does not hurt to pre-initialize "expr" to NULL. gdb/ChangeLog: * dtrace-probe.c (dtrace_process_dof_probe): Initialize expr to NULL.
This commit is contained in:
parent
0916f9e741
commit
79498702ef
2 changed files with 5 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
|||
2015-03-27 Joel Brobecker <brobecker@adacore.com>
|
||||
|
||||
* dtrace-probe.c (dtrace_process_dof_probe): Initialize expr to NULL.
|
||||
|
||||
2015-03-27 Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com>
|
||||
|
||||
* gdb_bfd.c (gdb_bfd_section_index): Fix off-by-one for special
|
||||
|
|
|
@ -413,7 +413,7 @@ dtrace_process_dof_probe (struct objfile *objfile,
|
|||
for (j = 0; j < ret->probe_argc; j++)
|
||||
{
|
||||
struct dtrace_probe_arg arg;
|
||||
struct expression *expr;
|
||||
struct expression *expr = NULL;
|
||||
|
||||
/* Set arg.expr to ensure all fields in expr are initialized and
|
||||
the compiler will not warn when arg is used. */
|
||||
|
|
Loading…
Add table
Reference in a new issue