This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/41918] Superflous warning "was declared INTENT(OUT) but was not set"
- From: "kargl at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Nov 2009 23:45:14 -0000
- Subject: [Bug fortran/41918] Superflous warning "was declared INTENT(OUT) but was not set"
- References: <bug-41918-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from kargl at gcc dot gnu dot org 2009-11-02 23:45 -------
This is sufficient to get rid of the warning. Note the removal
of 'static' is for debugging purposes. Note also that the check
for BT_DERIVED needs to actually check if a default initialization
would occur.
Index: gcc/fortran/trans-decl.c
===================================================================
--- gcc/fortran/trans-decl.c (revision 153823)
+++ gcc/fortran/trans-decl.c (working copy)
@@ -3762,7 +3762,9 @@ generate_dependency_declarations (gfc_sy
handling of expressions which only appear in the specification of
other functions. */
-static void
+void generate_local_decl (gfc_symbol *);
+
+void
generate_local_decl (gfc_symbol * sym)
{
if (sym->attr.flavor == FL_VARIABLE)
@@ -3776,8 +3778,11 @@ generate_local_decl (gfc_symbol * sym)
else if (warn_unused_variable
&& sym->attr.dummy
&& sym->attr.intent == INTENT_OUT)
- gfc_warning ("Dummy argument '%s' at %L was declared INTENT(OUT) but
was not set",
- sym->name, &sym->declared_at);
+ {
+ if (!(sym->ts.type == BT_DERIVED))
+ gfc_warning ("Dummy argument '%s' at %L was declared INTENT(OUT) "
+ "but was not set", sym->name, &sym->declared_at);
+ }
/* Specific warning for unused dummy arguments. */
else if (warn_unused_variable && sym->attr.dummy)
gfc_warning ("Unused dummy argument '%s' at %L", sym->name,
--
kargl at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |sgk at troutmask dot apl dot
| |washington dot edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41918