This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch for various warnings in gcc
- From: Michael Matz <matz at suse dot de>
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 8 Aug 2002 12:05:05 +0200 (CEST)
- Subject: Re: Patch for various warnings in gcc
Hi,
On Thu, 8 Aug 2002, Kaveh R. Ghazi wrote:
> The patch below fixes these warnings:
> > ra-build.c:1818: warning: `web' might be used uninitialized in this function
This warning is wrong, as web in fact is initialized in all possible
paths. There is no need for a fix, except maybe to silence the warning.
Wasn't there a gcc extension ala "int a = a;" to silence it?
> diff -rup orig/egcc-CVS20020806/gcc/ra-build.c egcc-CVS20020806/gcc/ra-build.c
> --- orig/egcc-CVS20020806/gcc/ra-build.c 2002-07-21 22:02:43.000000000 -0400
> +++ egcc-CVS20020806/gcc/ra-build.c 2002-08-07 13:41:35.658175411 -0400
> @@ -1815,7 +1815,7 @@ parts_to_webs_1 (df, copy_webs, all_refs
> webnum = 0;
> for (i = 0; i < def_id + use_id; i++)
> {
> - struct web *web, *subweb;
> + struct web *web = 0, *subweb;
I.e. couldn't this be "struct web *web = web;" ?
> struct web_part *wp = &web_parts[i];
> struct ref *ref = wp->ref;
> unsigned int ref_id;
Ciao,
Michael.