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]

Re: [PATCH] take 3: pragma FLOAT_CONST_DECIMAL64 for decimal float support


On Tue, 2009-05-12 at 22:40 -0400, David Edelsohn wrote:
> Janis,
> 
> This patch breaks AIX.  The ChangeLog does not mention the new
> 
> enum pragma_switch_t
> 
>         * c-pragma.c (valid_location_for_stdc_pragma,
> 	mark_valid_location_for_stdc_pragma,
> 	valid_location_for_stdc_pragma_p, handle_stdc_pragma,
> 	handle_pragma_float_const_decimal64): New.
> 
> The simple names in the enum conflict with AIX macros.  They should have used
> a more protected name like PRAGMA_BAD or C_PRAGMA_BAD or STDC_PRAGMA_BAD.

I've checked in the following as an obvious fix, after bootstrap of C
on powerpc64-linux and running the dfp.exp tests.

2009-05-13  Janis Johnson  <janis187@us.ibm.com>

	* c-pragma.c (enum pragma_switch_t): Prefix constants with PRAGMA_.
	(handle_stdc_pragma): Use new enum constant names.
	(handle_pragma_float_const_decimal64): Ditto.

Index: gcc/c-pragma.c
===================================================================
--- gcc/c-pragma.c	(revision 147489)
+++ gcc/c-pragma.c	(working copy)
@@ -1180,7 +1180,7 @@ valid_location_for_stdc_pragma_p (void)
   return valid_location_for_stdc_pragma;
 }
 
-enum pragma_switch_t { ON, OFF, DEFAULT, BAD };
+enum pragma_switch_t { PRAGMA_ON, PRAGMA_OFF, PRAGMA_DEFAULT, PRAGMA_BAD };
 
 /* A STDC pragma must appear outside of external declarations or
    preceding all explicit declarations and statements inside a compound
@@ -1198,33 +1198,33 @@ handle_stdc_pragma (const char *pname)
     {
       warning (OPT_Wpragmas, "invalid location for %<pragma %s%>, ignored",
 	       pname);
-      return BAD;
+      return PRAGMA_BAD;
     }
 
   if (pragma_lex (&t) != CPP_NAME)
     {
       warning (OPT_Wpragmas, "malformed %<#pragma %s%>, ignored", pname);
-      return BAD;
+      return PRAGMA_BAD;
     }
 
   arg = IDENTIFIER_POINTER (t);
 
   if (!strcmp (arg, "ON"))
-    ret = ON;
+    ret = PRAGMA_ON;
   else if (!strcmp (arg, "OFF"))
-    ret = OFF;
+    ret = PRAGMA_OFF;
   else if (!strcmp (arg, "DEFAULT"))
-    ret = DEFAULT;
+    ret = PRAGMA_DEFAULT;
   else
     {
       warning (OPT_Wpragmas, "malformed %<#pragma %s%>, ignored", pname);
-      return BAD;
+      return PRAGMA_BAD;
     }
 
   if (pragma_lex (&t) != CPP_EOF)
     {
       warning (OPT_Wpragmas, "junk at end of %<#pragma %s%>", pname);
-      return BAD;
+      return PRAGMA_BAD;
     }
 
   return ret;
@@ -1260,14 +1260,14 @@ handle_pragma_float_const_decimal64 (cpp
 
   switch (handle_stdc_pragma ("STDC FLOAT_CONST_DECIMAL64"))
     {
-    case ON:
+    case PRAGMA_ON:
       set_float_const_decimal64 ();
       break;
-    case OFF:
-    case DEFAULT:
+    case PRAGMA_OFF:
+    case PRAGMA_DEFAULT:
       clear_float_const_decimal64 ();
       break;
-    case BAD:
+    case PRAGMA_BAD:
       break;
     }
 }



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