aboutsummaryrefslogtreecommitdiff
path: root/gdb/dtrace-probe.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@adacore.com>2015-03-27 06:37:34 -0700
committerJoel Brobecker <brobecker@adacore.com>2015-03-27 08:25:28 -0700
commit79498702ef5f743481ee39c18418776715addcd6 (patch)
treed5f7042681b37eaa3faba5ef063c076d0c198466 /gdb/dtrace-probe.c
parent0916f9e741d6fd9dab4b0602bef034d01fa71650 (diff)
downloadgdb-79498702ef5f743481ee39c18418776715addcd6.zip
gdb-79498702ef5f743481ee39c18418776715addcd6.tar.gz
gdb-79498702ef5f743481ee39c18418776715addcd6.tar.bz2
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.
Diffstat (limited to 'gdb/dtrace-probe.c')
-rw-r--r--gdb/dtrace-probe.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/dtrace-probe.c b/gdb/dtrace-probe.c
index ff7ce7d..3f2548d 100644
--- a/gdb/dtrace-probe.c
+++ b/gdb/dtrace-probe.c
@@ -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. */