This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[toplev.c] warning control patch: -Wdeprecated-declarations
- From: DJ Delorie <dj at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 21 Jul 2005 21:32:03 -0400
- Subject: [toplev.c] warning control patch: -Wdeprecated-declarations
Is this considered an obvious change, given the warning control
project exists? The function warn_deprecated_use() explicitly checks
warn_deprecated_decl before doing anything else.
2005-07-21 DJ Delorie <dj@redhat.com>
* toplev.c (warn_deprecated_use): Add warning control to warning
call.
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.971
diff -p -U3 -r1.971 toplev.c
--- toplev.c 18 Jul 2005 21:14:14 -0000 1.971
+++ toplev.c 22 Jul 2005 01:26:18 -0000
@@ -875,7 +875,8 @@ warn_deprecated_use (tree node)
if (DECL_P (node))
{
expanded_location xloc = expand_location (DECL_SOURCE_LOCATION (node));
- warning (0, "%qs is deprecated (declared at %s:%d)",
+ warning (OPT_Wdeprecated_declarations,
+ "%qs is deprecated (declared at %s:%d)",
IDENTIFIER_POINTER (DECL_NAME (node)),
xloc.file, xloc.line);
}
@@ -898,18 +899,20 @@ warn_deprecated_use (tree node)
expanded_location xloc
= expand_location (DECL_SOURCE_LOCATION (decl));
if (what)
- warning (0, "%qs is deprecated (declared at %s:%d)", what,
- xloc.file, xloc.line);
+ warning (OPT_Wdeprecated_declarations,
+ "%qs is deprecated (declared at %s:%d)", what,
+ xloc.file, xloc.line);
else
- warning (0, "type is deprecated (declared at %s:%d)",
+ warning (OPT_Wdeprecated_declaration,
+ "type is deprecated (declared at %s:%d)",
xloc.file, xloc.line);
}
else
{
if (what)
- warning (0, "%qs is deprecated", what);
+ warning (OPT_Wdeprecated_declaration, "%qs is deprecated", what);
else
- warning (0, "type is deprecated");
+ warning (OPT_Wdeprecated_declaration, "type is deprecated");
}
}
}