public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/30549] New: compiler warning in resolve.c: possibly uninitialized use of name
@ 2007-01-22 22:11 burnus at gcc dot gnu dot org
2007-01-22 22:15 ` [Bug fortran/30549] " pinskia at gcc dot gnu dot org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-01-22 22:11 UTC (permalink / raw)
To: gcc-bugs
The compiler warns that in the function "resolve_function" of resolve.c:, the
variable "name" might be used unintialized. I think gcc is right.
Name is initialized with:
if (!pure_function (expr, &name) && name)
and later used without extra if(name) in:
if (expr->value.function.esym && !expr->value.function.esym->attr.recursive)
{
gfc_symbol *esym, *proc;
esym = expr->value.function.esym;
proc = gfc_current_ns->proc_name;
if (esym == proc)
{
gfc_error ("Function '%s' at %L cannot call itself, as it is not "
"RECURSIVE", name, &expr->where);
t = FAILURE;
}
if (esym->attr.entry && esym->ns->entries && proc->ns->entries
&& esym->ns->entries->sym == proc->ns->entries->sym)
{
gfc_error ("Call to ENTRY '%s' at %L is recursive, but function "
"'%s' is not declared as RECURSIVE",
esym->name, &expr->where, esym->ns->entries->sym->name);
t = FAILURE;
}
}
--
Summary: compiler warning in resolve.c: possibly uninitialized
use of name
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30549
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/30549] compiler warning in resolve.c: possibly uninitialized use of name
2007-01-22 22:11 [Bug fortran/30549] New: compiler warning in resolve.c: possibly uninitialized use of name burnus at gcc dot gnu dot org
@ 2007-01-22 22:15 ` pinskia at gcc dot gnu dot org
2007-01-22 22:25 ` burnus at gcc dot gnu dot org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-01-22 22:15 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2007-01-22 22:14 -------
Can you try after:
http://gcc.gnu.org/ml/gcc-cvs/2007-01/msg00765.html
?
>and later used without extra if(name) in:
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.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30549
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/30549] compiler warning in resolve.c: possibly uninitialized use of name
2007-01-22 22:11 [Bug fortran/30549] New: compiler warning in resolve.c: possibly uninitialized use of name burnus at gcc dot gnu dot org
2007-01-22 22:15 ` [Bug fortran/30549] " pinskia at gcc dot gnu dot org
@ 2007-01-22 22:25 ` burnus at gcc dot gnu dot org
2007-01-23 6:26 ` pault at gcc dot gnu dot org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-01-22 22:25 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from burnus at gcc dot gnu dot org 2007-01-22 22:25 -------
> 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.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30549
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/30549] compiler warning in resolve.c: possibly uninitialized use of name
2007-01-22 22:11 [Bug fortran/30549] New: compiler warning in resolve.c: possibly uninitialized use of name burnus at gcc dot gnu dot org
2007-01-22 22:15 ` [Bug fortran/30549] " pinskia at gcc dot gnu dot org
2007-01-22 22:25 ` burnus at gcc dot gnu dot org
@ 2007-01-23 6:26 ` pault at gcc dot gnu dot org
2007-01-23 7:19 ` pault at gcc dot gnu dot org
2007-01-23 16:26 ` mueller at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-01-23 6:26 UTC (permalink / raw)
To: gcc-bugs
------- 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/30549] compiler warning in resolve.c: possibly uninitialized use of name
2007-01-22 22:11 [Bug fortran/30549] New: compiler warning in resolve.c: possibly uninitialized use of name burnus at gcc dot gnu dot org
` (2 preceding siblings ...)
2007-01-23 6:26 ` pault at gcc dot gnu dot org
@ 2007-01-23 7:19 ` pault at gcc dot gnu dot org
2007-01-23 16:26 ` mueller at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-01-23 7:19 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from pault at gcc dot gnu dot org 2007-01-23 07:19 -------
Subject: Bug 30549
Author: pault
Date: Tue Jan 23 07:19:26 2007
New Revision: 121080
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121080
Log:
2007-01-23 Paul Thomas <pault@gcc.gnu.org>
PR fortran/30549
* resolve.c (pure_function): Add return of name for state-
ment functions..
Modified:
branches/gcc-4_2-branch/gcc/fortran/ChangeLog
branches/gcc-4_2-branch/gcc/fortran/resolve.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30549
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/30549] compiler warning in resolve.c: possibly uninitialized use of name
2007-01-22 22:11 [Bug fortran/30549] New: compiler warning in resolve.c: possibly uninitialized use of name burnus at gcc dot gnu dot org
` (3 preceding siblings ...)
2007-01-23 7:19 ` pault at gcc dot gnu dot org
@ 2007-01-23 16:26 ` mueller at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: mueller at gcc dot gnu dot org @ 2007-01-23 16:26 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from mueller at gcc dot gnu dot org 2007-01-23 16:26 -------
fortran seems to bootstrap now.
--
mueller at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30549
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-01-23 16:26 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-22 22:11 [Bug fortran/30549] New: compiler warning in resolve.c: possibly uninitialized use of name burnus at gcc dot gnu dot org
2007-01-22 22:15 ` [Bug fortran/30549] " pinskia at gcc dot gnu dot org
2007-01-22 22:25 ` burnus at gcc dot gnu dot org
2007-01-23 6:26 ` pault at gcc dot gnu dot org
2007-01-23 7:19 ` pault at gcc dot gnu dot org
2007-01-23 16:26 ` mueller at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).