This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch to poison (or wrap with !IN_GCC?) ansidecl.h macros
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 17 Jun 2003 00:17:10 -0400 (EDT)
- Subject: Patch to poison (or wrap with !IN_GCC?) ansidecl.h macros
This patch ensures we don't regress into reusing the ansidecl.h macros
for K&R compatibility. The two major macros (PARAMS and PTR) probably
can't go in here even after they're all cleaned out because they're
used in the libiberty headers which we include all over the place.
Nevertheless at least these won't come back.
I came up with two approaches. One was poisoning the macros, which
I've included below. The other would be to move the macros within
ansidecl.h into the !IN_GCC clause where we store other obsoleted
macros we don't want to use. (Look in ansidecl.h to see what I mean.)
I couldn't decide which way was better, but I have this one handy.
Thoughts?
This patch was bootstrapped on sparc-sun-solaris2.7.
Ok for mainline?
Thanks,
--Kaveh
2003-06-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* system.h (ANSI_PROTOTYPES, PTR_CONST, LONG_DOUBLE, VPARAMS,
VA_OPEN, VA_FIXEDARG, VA_CLOSE, VA_START): undef and poison these
libiberty macros.
diff -rup orig/egcc-CVS20030615/gcc/system.h egcc-CVS20030615/gcc/system.h
--- orig/egcc-CVS20030615/gcc/system.h 2003-06-07 20:01:36.000000000 -0400
+++ egcc-CVS20030615/gcc/system.h 2003-06-16 15:59:51.071172387 -0400
@@ -652,6 +652,17 @@ typedef char _Bool;
#pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \
LANG_HOOKS_MARK_TREE
+/* Libiberty macros that are no longer used in GCC. */
+#undef ANSI_PROTOTYPES
+#undef PTR_CONST
+#undef LONG_DOUBLE
+#undef VPARAMS
+#undef VA_OPEN
+#undef VA_FIXEDARG
+#undef VA_CLOSE
+#undef VA_START
+ #pragma GCC poison ANSI_PROTOTYPES PTR_CONST LONG_DOUBLE VPARAMS VA_OPEN \
+ VA_FIXEDARG VA_CLOSE VA_START
#endif /* IN_GCC */
/* Note: not all uses of the `index' token (e.g. variable names and