autoconf-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] Support a stack of LINENO values for AS_MESSAGE.


From: Eric Blake
Subject: Re: [PATCH] Support a stack of LINENO values for AS_MESSAGE.
Date: Tue, 14 Oct 2008 16:04:05 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Paolo Bonzini <bonzini <at> gnu.org> writes:

> 2008-10-14  Paolo Bonzini  <bonzini <at> gnu.org>
> 
>       * lib/m4sugar/m4sh.m4 (_AS_ECHO_LOG): If defined, use $as_lineno as
>       the line number emitted to the log file.
>       (AS_LINENO_PUSH, AS_LINENO_POP): New.
>       * tests/m4sh.at (LINENO Stack): New test.

Please apply, after fixing this nit:

> +m4_defun([AS_LINENO_PUSH], 
> +[dnl No, I am not going to comment on how this works.  The fun is yours.

Cute.  But putting the dnl inside the macro definition means the macro occupies 
that much more memory in m4 and takes that much longer to execute.  Please move 
the comment outside the macro definition (and repeated for AS_LINENO_PUSH).  (I 
want m4sugar and m4sh to be lean and mean because of their potential to be on 
hot paths; I'm not as worried about dnl usage in higher-level macros like 
AC_SUBST).

> +AT_SETUP([LINENO stack])
> +AT_KEYWORDS([m4sh])
> +
> +AT_DATA_M4SH([script.as],
> +[[AS_INIT
> +
> +AS_LINENO_PUSH([9999])

I was a little surprised to see that this test does not use functions, since it 
was the use of $LINENO within functions that raised the issue in the first 
place, but after further thought, a minimal test is always nicer.  So I don't 
think you need to change anything here.

-- 
Eric Blake







reply via email to

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