This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR 3451 fix for c-pragma.c
On Mon, Oct 29, 2001 at 08:39:35PM -0800, Richard Henderson wrote:
> On Sun, Oct 28, 2001 at 11:51:40PM -0500, Craig Rodrigues wrote:
> > * Rename macros BAD, BAD2, BAD_ACTION to
> > GCC_BAD, GCC_BAD2, GCC_BAD_ACTION in order to
> > avoid conflicting with similarly named macros defined
> > in AIX's sys/param.h.
>
> Ok, but with a proper changelog entry.
I don't have commit privileges, so if someone could commit
this I'd appreciate it.
2001-10-28 Craig Rodrigues <rodrigc@gcc.gnu.org>
PR bootstrap/3451
* c-pragma.c: Rename macros BAD, BAD2, BAD_ACTION to
GCC_BAD, GCC_BAD2, GCC_BAD_ACTION.
Index: c-pragma.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-pragma.c,v
retrieving revision 1.45
diff -u -r1.45 c-pragma.c
--- c-pragma.c 2001/08/31 19:27:12 1.45
+++ c-pragma.c 2001/10/29 04:44:21
@@ -33,8 +33,8 @@
#include "output.h"
#include "tm_p.h"
-#define BAD(msgid) do { warning (msgid); return; } while (0)
-#define BAD2(msgid, arg) do { warning (msgid, arg); return; } while (0)
+#define GCC_BAD(msgid) do { warning (msgid); return; } while (0)
+#define GCC_BAD2(msgid, arg) do { warning (msgid, arg); return; } while (0)
#ifdef HANDLE_PRAGMA_PACK
static void handle_pragma_pack PARAMS ((cpp_reader *));
@@ -159,9 +159,9 @@
#else /* not HANDLE_PRAGMA_PACK_PUSH_POP */
#define SET_GLOBAL_ALIGNMENT(ALIGN) (maximum_field_alignment = (ALIGN))
#define push_alignment(ID, N) \
- BAD("#pragma pack(push[, id], <n>) is not supported on this target")
+ GCC_BAD("#pragma pack(push[, id], <n>) is not supported on this target")
#define pop_alignment(ID) \
- BAD("#pragma pack(pop[, id], <n>) is not supported on this target")
+ GCC_BAD("#pragma pack(pop[, id], <n>) is not supported on this target")
#endif /* HANDLE_PRAGMA_PACK_PUSH_POP */
/* #pragma pack ()
@@ -181,7 +181,7 @@
enum { set, push, pop } action;
if (c_lex (&x) != CPP_OPEN_PAREN)
- BAD ("missing '(' after '#pragma pack' - ignored");
+ GCC_BAD ("missing '(' after '#pragma pack' - ignored");
token = c_lex (&x);
if (token == CPP_CLOSE_PAREN)
@@ -194,14 +194,14 @@
align = TREE_INT_CST_LOW (x);
action = set;
if (c_lex (&x) != CPP_CLOSE_PAREN)
- BAD ("malformed '#pragma pack' - ignored");
+ GCC_BAD ("malformed '#pragma pack' - ignored");
}
else if (token == CPP_NAME)
{
-#define BAD_ACTION do { if (action == push) \
- BAD ("malformed '#pragma pack(push[, id], <n>)' - ignored"); \
+#define GCC_BAD_ACTION do { if (action == push) \
+ GCC_BAD ("malformed '#pragma pack(push[, id], <n>)' - ignored"); \
else \
- BAD ("malformed '#pragma pack(pop[, id])' - ignored"); \
+ GCC_BAD ("malformed '#pragma pack(pop[, id])' - ignored"); \
} while (0)
const char *op = IDENTIFIER_POINTER (x);
@@ -210,11 +210,11 @@
else if (!strcmp (op, "pop"))
action = pop;
else
- BAD2 ("unknown action '%s' for '#pragma pack' - ignored", op);
+ GCC_BAD2 ("unknown action '%s' for '#pragma pack' - ignored", op);
token = c_lex (&x);
if (token != CPP_COMMA && action == push)
- BAD_ACTION;
+ GCC_BAD_ACTION;
if (token == CPP_COMMA)
{
@@ -223,7 +223,7 @@
{
id = x;
if (action == push && c_lex (&x) != CPP_COMMA)
- BAD_ACTION;
+ GCC_BAD_ACTION;
token = c_lex (&x);
}
@@ -235,16 +235,16 @@
token = c_lex (&x);
}
else
- BAD_ACTION;
+ GCC_BAD_ACTION;
}
}
if (token != CPP_CLOSE_PAREN)
- BAD_ACTION;
-#undef BAD_ACTION
+ GCC_BAD_ACTION;
+#undef GCC_BAD_ACTION
}
else
- BAD ("malformed '#pragma pack' - ignored");
+ GCC_BAD ("malformed '#pragma pack' - ignored");
if (c_lex (&x) != CPP_EOF)
warning ("junk at end of '#pragma pack'");
@@ -261,7 +261,7 @@
align *= BITS_PER_UNIT;
break;
default:
- BAD2 ("alignment must be a small power of two, not %d", align);
+ GCC_BAD2 ("alignment must be a small power of two, not %d", align);
}
switch (action)
@@ -287,12 +287,12 @@
value = 0;
if (c_lex (&name) != CPP_NAME)
- BAD ("malformed #pragma weak, ignored");
+ GCC_BAD ("malformed #pragma weak, ignored");
t = c_lex (&x);
if (t == CPP_EQ)
{
if (c_lex (&value) != CPP_NAME)
- BAD ("malformed #pragma weak, ignored");
+ GCC_BAD ("malformed #pragma weak, ignored");
t = c_lex (&x);
}
if (t != CPP_EOF)
--
Craig Rodrigues
http://www.gis.net/~craigr
rodrigc@mediaone.net