This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/30549] compiler warning in resolve.c: possibly uninitialized use of name
- From: "pault at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Jan 2007 06:26:14 -0000
- Subject: [Bug fortran/30549] compiler warning in resolve.c: possibly uninitialized use of name
- References: <bug-30549-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from pault at gcc dot gnu dot org 2007-01-23 06:26 -------
(In reply to comment #2)
> > No, that means it is used possiable as null.
> > You need to check inside pure_function to see if there is a way that the
> > second argument does not get initialized.
>
> There is:
> if (e->symtree != NULL
> && e->symtree->n.sym != NULL
> && e->symtree->n.sym->attr.proc == PROC_ST_FUNCTION)
> return 1;
>
> One could thus either add a line in pure_function or in "resolve_function" to
> set name to null. Or in both. Having it in "resolve_function" means we get rid
> of this warning.
>
No, it must be
if (e->symtree != NULL
&& e->symtree->n.sym != NULL
&& e->symtree->n.sym->attr.proc == PROC_ST_FUNCTION)
{
*name = e->symtree->n.sym->name;
return 1;
}
for consistency.
Paul
PS That was my doing, so will fix as obvious.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30549