This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[warnings] attribs.c


This is the first of what I *hope* will be a lot of per-file patches
to start replacing "warning (0, " with a non-zero value.  For my own
sanity, I'm not going to try to include a diff for common.opt or
docs/invoke.texi, for the same reason we don't use diffs for
ChangeLog, until I collect a bunch of approvals, enough to warrant a
full bootstrap/regression cycle, at which point I'll post a full patch
for final approval.

I.e. I'm asking for approval for the logic changes I'm making, since
some might affect performance more than warranted.  Breaking it up by
file makes it easier to follow threads, too.

For this file, there are three warnings which weren't previously
controllable at all.  I've lumped them all into a single new
default-enabled warning for now.

Wattributes
Common Var(warn_attributes) Init(1)
Warn about unexpected attribute usage

@item -Wno-attributes
@opindex Wno-attributes
@opindex Wattributes
Do not warn if an unexpected @code{__attribute__} is used, such as
unrecognized attributes, function attributes applied to variables,
etc.  This will not stop errors for incorrect use of supported
attributes.

Index: attribs.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/attribs.c,v
retrieving revision 1.37
diff -p -U3 -r1.37 attribs.c
--- attribs.c	28 Apr 2005 05:38:30 -0000	1.37
+++ attribs.c	4 May 2005 20:11:33 -0000
@@ -172,7 +172,7 @@ decl_attributes (tree *node, tree attrib
 
       if (spec == NULL)
 	{
-	  warning (0, "%qs attribute directive ignored",
+	  warning (OPT_Wattributes, "%qs attribute directive ignored",
 		   IDENTIFIER_POINTER (name));
 	  continue;
 	}
@@ -197,7 +197,7 @@ decl_attributes (tree *node, tree attrib
 	    }
 	  else
 	    {
-	      warning (0, "%qs attribute does not apply to types",
+	      warning (OPT_Wattributes, "%qs attribute does not apply to types",
 		       IDENTIFIER_POINTER (name));
 	      continue;
 	    }
@@ -243,7 +243,7 @@ decl_attributes (tree *node, tree attrib
 	  if (TREE_CODE (*anode) != FUNCTION_TYPE
 	      && TREE_CODE (*anode) != METHOD_TYPE)
 	    {
-	      warning (0, "%qs attribute only applies to function types",
+	      warning (OPT_Wattributes, "%qs attribute only applies to function types",
 		       IDENTIFIER_POINTER (name));
 	      continue;
 	    }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]