This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31129] No warning on unused parameters
- From: "dfranke at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Jul 2007 10:18:26 -0000
- Subject: [Bug fortran/31129] No warning on unused parameters
- References: <bug-31129-14178@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from dfranke at gcc dot gnu dot org 2007-07-09 10:18 -------
Emit a warning if an unused parameter is found (-Wunused/-Wall), currently
regtesting:
Index: trans-decl.c
===================================================================
--- trans-decl.c (revision 126478)
+++ trans-decl.c (working copy)
@@ -3035,6 +3035,12 @@
if (sym->attr.dummy && sym->backend_decl != NULL_TREE)
TREE_NO_WARNING(sym->backend_decl) = 1;
}
+ else if (sym->attr.flavor == FL_PARAMETER)
+ {
+ if (warn_unused_variable && !sym->attr.referenced)
+ gfc_warning ("unused parameter '%s' declared at %L", sym->name,
+ &sym->declared_at);
+ }
if (sym->attr.dummy == 1)
{
--
dfranke at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dfranke at gcc dot gnu dot
| |org
AssignedTo|unassigned at gcc dot gnu |dfranke at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Last reconfirmed|2007-03-17 11:40:46 |2007-07-09 10:18:26
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31129