From: Eric Blake Date: Thu, 18 Dec 2008 22:55:58 +0000 (-0700) Subject: Mention limitation of M4 1.4.x on builtin tokens. X-Git-Tag: v2.63b~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59f80f3aeae4a77753deb5944d5c77a9cf83c629;p=thirdparty%2Fautoconf.git Mention limitation of M4 1.4.x on builtin tokens. * doc/autoconf.texi (Redefined M4 Macros) : Document ramification of M4 1.4.x's inability to pass builtin tokens through text macros. (Evaluation Macros) : Likewise. * tests/m4sugar.at (m4@&t@_defn): Enhance test. * NEWS: Mention subtle change in m4_dumpdef semantics. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index 86c6c4b62..c1d367a6f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2008-12-18 Eric Blake + Mention limitation of M4 1.4.x on builtin tokens. + * doc/autoconf.texi (Redefined M4 Macros) : Document + ramification of M4 1.4.x's inability to pass builtin tokens + through text macros. + (Evaluation Macros) : Likewise. + * tests/m4sugar.at (m4@&t@_defn): Enhance test. + * NEWS: Mention subtle change in m4_dumpdef semantics. + Document m4_version_prereq. * doc/autoconf.texi (Number processing Macros) : Add documentation. diff --git a/NEWS b/NEWS index 2e7fa1e34..30ac715a3 100644 --- a/NEWS +++ b/NEWS @@ -29,7 +29,9 @@ GNU Autoconf NEWS - User visible changes. m4_chomp m4_curry m4_default_quoted m4_esyscmd_s m4_map_args m4_map_args_pair m4_set_map -** The following m4sugar macros are documented now: +** The following m4sugar macros are documented now, but in some cases + with slightly different semantics than what the previous + undocumented version had: m4_copy m4_dumpdefs m4_rename m4_version_prereq ** The m4sugar macro m4_expand has been taught to handle unterminated diff --git a/doc/autoconf.texi b/doc/autoconf.texi index aeeb38817..1e211a19e 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -10563,6 +10563,12 @@ rather than the current debug file, and an error is issued if any calls @code{m4_dumpdef} for all of the @code{m4_pushdef} stack of definitions, starting with the current, and silently does nothing if @var{name} is undefined. + +Unfortunately, due to a limitation in M4 1.4.x, any macro defined as a +builtin is output as the empty string. This behavior is rectified by +using M4 1.6 or newer. However, this behavior difference means that +@code{m4_dumpdef} should only be used while developing m4sugar macros, +and never in the final published form of a macro. @end defmac @defmac m4_esyscmd_s (@var{command}) @@ -11270,6 +11276,11 @@ with the resulting argument list. m4_curry([m4_curry], [m4_reverse], [1])([2])([3]) @result{}3, 2, 1 @end example + +Unfortunately, due to a limitation in M4 1.4.x, it is not possible to +pass the definition of a builtin macro as the argument to the output of +@code{m4_curry}; the empty string is used instead of the builtin token. +This behavior is rectified by using M4 1.6 or newer. @end defmac @defmac m4_do (@var{arg}, @dots{}) diff --git a/tests/m4sugar.at b/tests/m4sugar.at index 36787fc04..8a538f0ad 100644 --- a/tests/m4sugar.at +++ b/tests/m4sugar.at @@ -138,6 +138,7 @@ AT_CHECK([grep 'm4@&t@_undefine: undefined.*oops' stderr], [0], [ignore]) # Check that pushdef stacks can be renamed. AT_CHECK_M4SUGAR_TEXT([[m4_pushdef([a], [1])dnl m4_pushdef([a], [2])dnl +m4_pushdef([a], m4_defn([m4_divnum]))dnl a b c m4_rename([a], [b])dnl a b c @@ -147,8 +148,11 @@ m4_popdef([b], [c])dnl a b c m4_popdef([b], [c])dnl a b c -]], [[2 b c -a 2 c +m4_popdef([b], [c])dnl +a b c +]], [[0 b c +a 0 c +a 0 0 a 2 2 a 1 1 a b c