This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]