]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Fix '#undef variable /* comment */' transform in config headers.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Tue, 17 Jun 2008 06:42:14 +0000 (08:42 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Tue, 17 Jun 2008 06:42:14 +0000 (08:42 +0200)
* lib/autoconf/status.m4 (_AC_OUTPUT_HEADERS_PREPARE): For
undefined preprocessor macros that are followed by a comment
in the header template, do not create nested comments in the
output.
* tests/torture.at (@%:@define header templates): Extend test.
* NEWS: Update.
Report by Karsten Hopp <karsten@redhat.com>.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
NEWS
lib/autoconf/status.m4
tests/torture.at

index 906ed7172ec6d73f98f116a5a7bb8e633fd25789..a48f5c779f5babb4ab395db5efa6f93a8c8737ac 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2008-06-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Fix '#undef variable /* comment */' transform in config headers.
+       * lib/autoconf/status.m4 (_AC_OUTPUT_HEADERS_PREPARE): For
+       undefined preprocessor macros that are followed by a comment
+       in the header template, do not create nested comments in the
+       output.
+       * tests/torture.at (@%:@define header templates): Extend test.
+       * NEWS: Update.
+       Report by Karsten Hopp <karsten@redhat.com>.
+
 2008-06-09  Eric Blake  <ebb9@byu.net>
 
        Mark AC_TYPE_SIGNAL as obsolete.
diff --git a/NEWS b/NEWS
index 945c9947121acc005e7b51105ec63c93f4097554..06b705f7d81c8a3c9b148c18a4e39378aef42403 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -23,6 +23,9 @@ GNU Autoconf NEWS - User visible changes.
    AT_KEYWORDS([m4_if([$1], [], [default])]) no longer complains about
    the possibly unexpanded m4_if [regression introduced in 2.62].
 
+** Config header templates `#undef UNDEFINED /* comment */' do not lead to
+   nested comments any more; regression introduced in 2.62.
+
 \f
 * Major changes in Autoconf 2.62 (2008-04-05) [stable]
   Released by Eric Blake, based on git versions 2.61a.*.
index 50be77b61b44dcdb7b5a6223f79552399e718727..d5ed32395c0aea794b07ada19683363d1d9e8484 100644 (file)
@@ -832,9 +832,9 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
   }
   split(mac1, mac2, "(") #)
   macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
   if (D_is_set[macro]) {
     # Preserve the white space surrounding the "#".
-    prefix = substr(line, 1, index(line, defundef) - 1)
     print prefix "define", macro P[macro] D[macro]
     next
   } else {
@@ -842,7 +842,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
     # in the case of _POSIX_SOURCE, which is predefined and required
     # on some systems where configure will not decide to define it.
     if (defundef == "undef") {
-      print "/*", line, "*/"
+      print "/*", prefix defundef, macro, "*/"
       next
     }
   }
index c37dabae052a4073f1c71b42e9389dabaa684be0..92f8d5b7561db233da5d4de7dea69db4896444e7 100644 (file)
@@ -497,6 +497,8 @@ AT_DATA([config.hin],
 #define str(define) \
 #define
 #define stringify(arg) str(arg)
+#undef aaa /* with comments */
+#undef not_substed /* with comments */
 ]])
 
 AT_CHECK_AUTOCONF
@@ -527,6 +529,8 @@ ARG1
 #define str(define) \
 #define
 #define stringify(arg) str(arg)
+#define aaa AAA
+/* #undef not_substed */
 ]])
 AT_CHECK([cat config.h], 0, expout)