]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
autom4te: don't filter out portions of location traces
authorEric Blake <eblake@redhat.com>
Mon, 20 Sep 2010 21:00:28 +0000 (15:00 -0600)
committerEric Blake <eblake@redhat.com>
Mon, 20 Sep 2010 22:01:16 +0000 (16:01 -0600)
* bin/autom4te.in (_m4_warn): Pass warnings through the channels
machinery as a single chunk, to avoid partial filtering.
* lib/m4sugar/m4sugar.m4 (_m4_warn): Document the conventions.
* tests/m4sugar.at (m4@&t@_warn): Enhance test to catch this.
Reported by Bruno Haible.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
bin/autom4te.in
lib/m4sugar/m4sugar.m4
tests/m4sugar.at

index 458343f6a489c06ee387383fe4017aedec57840b..1b47a2c429e3cf83f3eb8de822ff3904785cb1b9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2010-09-20  Eric Blake  <eblake@redhat.com>
+
+       autom4te: don't filter out portions of location traces
+       * bin/autom4te.in (_m4_warn): Pass warnings through the channels
+       machinery as a single chunk, to avoid partial filtering.
+       * lib/m4sugar/m4sugar.m4 (_m4_warn): Document the conventions.
+       * tests/m4sugar.at (m4@&t@_warn): Enhance test to catch this.
+       Reported by Bruno Haible.
+
 2010-09-17  Eric Blake  <eblake@redhat.com>
 
        build: support autobuild
index e1d40e3c7db1ae7a63c6ee2f23d91aac2c334b2d..e54aa080f073c280349e5d03d8df573e0f4e479e 100644 (file)
@@ -1021,12 +1021,15 @@ for (split (/\n*$separator\n*/o, contents ("$tmp/warnings")))
   # | input.as:2: bar is expanded from...
   # | input.as:3: foo is expanded from...
   # | input.as:5: the top level
+  # In particular, m4_warn guarantees that either $stackdump is empty, or
+  # it consists of lines where only the last line ends in "top level".
   my ($cat, $loc, $msg, $stacktrace) = split ('::', $_, 4);
-  msg $cat, $loc, "warning: $msg";
+  msg $cat, $loc, "warning: $msg",
+    partial => ($stacktrace =~ /top level$/) + 0;
   for (split /\n/, $stacktrace)
     {
       my ($loc, $trace) = split (': ', $_, 2);
-      msg $cat, $loc, $trace;
+      msg $cat, $loc, $trace, partial => ($trace !~ /top level$/) + 0;
     }
 }
 
index d440127199332c19ec28de207a4978a0d22024f4..282cd797879b03957e8e76a87d02af430b68d67e 100644 (file)
@@ -231,11 +231,12 @@ m4_define([m4_assert],
 ## ------------- ##
 
 
-# _m4_warn(CATEGORY, MESSAGE, STACK-TRACE)
-# ----------------------------------------
+# _m4_warn(CATEGORY, MESSAGE, [STACK-TRACE])
+# ------------------------------------------
 # Report a MESSAGE to the user if the CATEGORY of warnings is enabled.
 # This is for traces only.
-# The STACK-TRACE is a \n-separated list of "LOCATION: MESSAGE".
+# If present, STACK-TRACE is a \n-separated list of "LOCATION: MESSAGE",
+# where the last line (and no other) ends with "the top level".
 #
 # Within m4, the macro is a no-op.  This macro really matters
 # when autom4te post-processes the trace output.
index 900bc3bdd547d874c6dd1a5456e8320b71ffecf5..f5182dc922e0c9dfda4bc080d52719712ff66667 100644 (file)
@@ -245,15 +245,14 @@ AT_CLEANUP
 
 AT_SETUP([m4@&t@_warn])
 
-# FIXME: For the time being we use -f to make sure we do issue the
-# warnings.  But maybe autom4te should handle that by itself?
-
 AT_DATA_M4SUGAR([script.4s],
 [[m4_init
-m4_defun([cross_warning], [m4_warn([cross],  [cross])])
+m4_defun([cross_warning], [m4_warn([cross], [cross])])
 
 m4_divert([0])dnl
-m4_warn([obsolete],  [obsolete])dnl
+m4_warn([obsolete], [obsolete])dnl
+cross_warning[]dnl
+m4_warn([syntax], [syntax])dnl
 cross_warning[]dnl
 m4_warn([syntax], [syntax])dnl
 ]])
@@ -261,27 +260,38 @@ m4_warn([syntax], [syntax])dnl
 AT_CHECK_M4SUGAR([-o-], 0, [],
 [script.4s:4: warning: prefer named diversions
 script.4s:7: warning: syntax
+script.4s:9: warning: syntax
 ])
 
-AT_CHECK_M4SUGAR([-o- -Wall -f], 0, [],
+AT_CHECK_M4SUGAR([-o- -Wall], 0, [],
 [script.4s:4: warning: prefer named diversions
 script.4s:5: warning: obsolete
 script.4s:6: warning: cross
 script.4s:2: cross_warning is expanded from...
 script.4s:6: the top level
 script.4s:7: warning: syntax
+script.4s:8: warning: cross
+script.4s:2: cross_warning is expanded from...
+script.4s:8: the top level
+script.4s:9: warning: syntax
 ])
 
-AT_CHECK_M4SUGAR([-o- -Wnone,cross -f], 0, [],
+AT_CHECK_M4SUGAR([-o- -Wnone,cross], 0, [],
 [script.4s:6: warning: cross
 script.4s:2: cross_warning is expanded from...
 script.4s:6: the top level
+script.4s:8: warning: cross
+script.4s:2: cross_warning is expanded from...
+script.4s:8: the top level
 ])
 
-AT_CHECK_M4SUGAR([-o- -Wnone,cross,error -f], 1, [],
+AT_CHECK_M4SUGAR([-o- -Wnone,cross,error], 1, [],
 [[script.4s:6: warning: cross
 script.4s:2: cross_warning is expanded from...
 script.4s:6: the top level
+script.4s:8: warning: cross
+script.4s:2: cross_warning is expanded from...
+script.4s:8: the top level
 ]])
 
 AT_CLEANUP