[Top][All Lists]

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

[PATCH] autom4te: Handle m4 traces without file:line

From: Roman Bolshakov
Subject: [PATCH] autom4te: Handle m4 traces without file:line
Date: Sat, 20 Oct 2018 21:00:40 +0300

The symptoms are something like:

  Use of uninitialized value $msg in concatenation (.) or string
   at /usr/local/Cellar/autoconf/2.69/bin/autom4te line 1032.
  Use of uninitialized value $stacktrace in pattern match (m//)
   at /usr/local/Cellar/autoconf/2.69/bin/autom4te line 1032.
  unknown channel m4trace: -1- AS_VAR_APPEND(ac_configure_args, " '$ac_arg'")
   at /usr/local/Cellar/autoconf/2.69/share/autoconf/Autom4te/ line 

The root cause is m4 traces without a file/line number shown.

So instead of something like: -1- ...

you have something like:

  m4trace: -1- ...

The issue was first reported by Christophe de Dinechin as bug #25740:

He then provided two variants of the fixes in the thread:

The first fix skips errors that can't be handled by autom4te.
The second one sets file and line number to placeholders.
This is a resend of the second fix.

Signed-off-by: Christophe de Dinechin <address@hidden>
Signed-off-by: Roman Bolshakov <address@hidden>
 bin/ | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/bin/ b/bin/
index abe6327d..de4d96b4 100644
--- a/bin/
+++ b/bin/
@@ -829,6 +829,9 @@ EOF
       # Traces without arguments, always on a single line.
       s{^m4trace:(.+):(\d+): -(\d+)- ([^)]*)\n$}
        {AT_$4([$1], [$2], [$3], [$4])\n};
+      # Traces without file and line number.
+      s{^m4trace: -(\d+)- ([^(]+)\((.*)$}
+       {AT_$2([nowhere], [0], [$1], [$2], $3};
       print $trace_m4 "$_";

reply via email to

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