m4-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: 74-gary-fix-namespace-pollution.patch


From: Gary V. Vaughan
Subject: FYI: 74-gary-fix-namespace-pollution.patch
Date: Fri, 10 Oct 2003 15:02:05 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20030925 Thunderbird/0.3

Applied to HEAD.
--
  ())_.  Gary V. Vaughan    gary@(lilith.warpmail.net|gnu.org)
  ( '/   Research Scientist http://www.oranda.demon.co.uk       ,_())____
  / )=   GNU Hacker         http://www.gnu.org/software/libtool  \'      `&
`(_~)_   Tech' Author       http://sources.redhat.com/autobook   =`---d__/
Index: ChangeLog
from  Gary V. Vaughan  <address@hidden>

        Tru64UNIX perl is sloppy with namespace pollution.  This patch is
        careful not to trip over the mess:

        * modules/perl.c: Some builds of perl install headers that contain
        `#define try __builtin_try'.  Be sure to undefine that macro
        before `m4/hash.h' gets included, which uses the `try' symbol.
        * m4/system_.h: Similarly for `bool'.  Undefine `bool', `true' and
        `false' before including `stdbool.h'.
        (DELETE):  This symbol is not in m4's namespace, and is in any
        case only used internally...
        * m4/m4private.h (DELETE): ...so move it to here.
        Reported by Martin MOKREJS <address@hidden>

2003-10-08  Paul Eggert  <address@hidden>
Index: m4/m4private.h
===================================================================
RCS file: /cvsroot/m4/m4/m4/m4private.h,v
retrieving revision 1.39
diff -u -p -u -r1.39 m4private.h
--- m4/m4private.h 8 Oct 2003 14:46:12 -0000 1.39
+++ m4/m4private.h 10 Oct 2003 13:04:23 -0000
@@ -312,6 +312,13 @@ struct m4__search_path_info {
          putc ('\n', m4_get_debug_file (C));                           \
        }                                               } M4_STMT_END
 
+
+
+
+/* Convenience macro to zero a variable after freeing it.  */
+#define DELETE(Expr)   ((Expr) = (free (Expr), (void *) 0))
+
+
 #if DEBUG
 # define DEBUG_INPUT
 # define DEBUG_MACRO
Index: m4/system_.h
===================================================================
RCS file: /cvsroot/m4/m4/m4/system_.h,v
retrieving revision 1.8
diff -u -p -u -r1.8 system_.h
--- m4/system_.h 7 Oct 2003 14:10:14 -0000 1.8
+++ m4/system_.h 10 Oct 2003 13:04:23 -0000
@@ -18,7 +18,7 @@
 */
 
 /**
- * @configure_generated@
+ * @configure_output@
  *
  * This file is installed, so cannot rely on the contents of config.h.
  * It works best if included _after_ system headers.
@@ -33,7 +33,14 @@
 @INCLUDE_ERROR_H@
 @INCLUDE_OBSTACK_H@
 @INCLUDE_REGEX_H@
+
+/* These are not in m4's namespace so for safety undefine any errant
+   definitions before including stdbool.h.  */
+#undef bool
+#undef false
+#undef true
 @INCLUDE_STDBOOL_H@
+
 #include <m4/exit.h>
 #include <m4/xalloc.h>
 #include <m4/xstrndup.h>
@@ -146,10 +153,6 @@ BEGIN_C_DECLS
 #  define _CONC(a, b)  a##b
 #  define CONC(a, b)   _CONC(a, b)
 #endif
-
-
-
-#define DELETE(Expr)   ((Expr) = (free (Expr), (void *) 0))
 
 END_C_DECLS
 
Index: modules/perl.c
===================================================================
RCS file: /cvsroot/m4/m4/modules/perl.c,v
retrieving revision 1.12
diff -u -p -u -r1.12 perl.c
--- modules/perl.c 27 Aug 2003 17:10:12 -0000 1.12
+++ modules/perl.c 10 Oct 2003 13:04:23 -0000
@@ -23,6 +23,7 @@
 #undef PACKAGE
 
 #include "perlxsi.c"                   /* Perl stuff */
+#undef try
 #undef _
 
 #include <m4module.h>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]