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]

[PATCH, named-addr-spaces-branch] Undo clearing the named address space qualifiers on functions


2009-04-03  Michael Meissner  <meissner@linux.vnet.ibm.com>

	* c-decl.c (grokdeclarator): Undo clearing the named address space
	qualifiers when checking whether a function has type qualifiers.

Getting back to the named address space branch to get it ready for checkin to
GCC 4.5, I put in the following fix.  I believe this answers Joseph Myers long
standing complaint about the patch.  Sorry for being somewhat obtuse and not
seeing what Joseph was complaining about.

Index: gcc/c-decl.c
===================================================================
--- gcc/c-decl.c	(revision 145472)
+++ gcc/c-decl.c	(working copy)
@@ -4714,7 +4714,7 @@ grokdeclarator (const struct c_declarato
 	       for the pointer.  */
 
 	    if (pedantic && TREE_CODE (type) == FUNCTION_TYPE
-		&& CLEAR_QUAL_ADDR_SPACE (type_quals))
+		&& type_quals)
 	      pedwarn (input_location, OPT_pedantic,
 		       "ISO C forbids qualified function types");
 	    if (type_quals)
@@ -4837,7 +4837,7 @@ grokdeclarator (const struct c_declarato
     {
       tree decl;
       if (pedantic && TREE_CODE (type) == FUNCTION_TYPE
-	  && CLEAR_QUAL_ADDR_SPACE (type_quals))
+	  && type_quals)
 	pedwarn (input_location, OPT_pedantic,
 		 "ISO C forbids qualified function types");
       if (type_quals)
@@ -4861,7 +4861,7 @@ grokdeclarator (const struct c_declarato
       gcc_assert (storage_class == csc_none && !threadp
 		  && !declspecs->inline_p);
       if (pedantic && TREE_CODE (type) == FUNCTION_TYPE
-	  && CLEAR_QUAL_ADDR_SPACE (type_quals))
+	  && type_quals)
 	pedwarn (input_location, OPT_pedantic,
 		 "ISO C forbids const or volatile function types");
       if (type_quals)
@@ -4927,7 +4927,7 @@ grokdeclarator (const struct c_declarato
 	  }
 	else if (TREE_CODE (type) == FUNCTION_TYPE)
 	  {
-	    if (CLEAR_QUAL_ADDR_SPACE (type_quals))
+	    if (type_quals)
 	      pedwarn (input_location, OPT_pedantic,
 		       "ISO C forbids qualified function types");
 	    if (type_quals)
@@ -5016,8 +5016,7 @@ grokdeclarator (const struct c_declarato
 	DECL_SOURCE_LOCATION (decl) = declarator->id_loc;
 	decl = build_decl_attribute_variant (decl, decl_attr);
 
-	if (pedantic && CLEAR_QUAL_ADDR_SPACE (type_quals)
-	    && !DECL_IN_SYSTEM_HEADER (decl))
+	if (pedantic && type_quals && !DECL_IN_SYSTEM_HEADER (decl))
 	  pedwarn (input_location, OPT_pedantic,
 		   "ISO C forbids qualified function types");
 

-- 
Michael Meissner, IBM
4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA
meissner@linux.vnet.ibm.com


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