This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: gdb fails to compile with GCC 4.4.7 (was: [PATCH V4 5/9] New probe type: DTrace USDT probes.)
- From: Tobias Burnus <tobias dot burnus at physik dot fu-berlin dot de>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 27 Mar 2015 16:17:54 +0100
- Subject: Re: gdb fails to compile with GCC 4.4.7 (was: [PATCH V4 5/9] New probe type: DTrace USDT probes.)
- Authentication-results: sourceware.org; auth=none
- References: <20150326210014 dot GC13867 at adacore dot com> <20150327094653 dot GA29713 at physik dot fu-berlin dot de> <20150327134252 dot GD13867 at adacore dot com>
On Fri, Mar 27, 2015 at 06:42:52AM -0700, Joel Brobecker wrote:
> > 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?
Yes, it now also compiles with GCC 4.4. Thanks for the fix!
Tobias
> * dtrace-probe.c (dtrace_process_dof_probe): Initialize expr to NULL.
> ---
> gdb/dtrace-probe.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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. */
> --
> 1.9.1
>