This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Unused variable warnings
- From: law at redhat dot com
- To: Jan Hubicka <jh at suse dot cz>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, Richard Henderson <rth at redhat dot com>, Andrew MacLeod <amacleod at redhat dot com>, gcc mailing list <gcc at gcc dot gnu dot org>, Diego Novillo <dnovillo at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Sat, 18 Oct 2003 22:19:56 -0600
- Subject: Re: [tree-ssa] Unused variable warnings
- Reply-to: law at redhat dot com
In message <20031017193025.GO6212@kam.mff.cuni.cz>, Jan Hubicka writes:
>OK,
>I have one problem. It is a warning:
>../../gcc/haifa-sched.c:2042: warning: 'index' might be used uninitialized in
> this function
>
>index is initialized by:
>if (max_issue (ready, &index) == 0)
>
>where max_issue is function that really has path throught that really
>does not write into the index variable, so this warning is de-facto
>right, just not obvious. What do we want to do here?
If there's really a path were index is uninitialized, then clearly we
want to initialize it to a safe value, both for the branch and the
mainline.
>Shall I simply add initializer to this variable and another one in
>f/lex.c as we do in usual case of this warning?
If f/lex.c also has a real path where the variable is uninitialized, yes
(and again, the same patch probably belongs on the mainline).
jeff