]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Mention limitation of M4 1.4.x on builtin tokens.
authorEric Blake <ebb9@byu.net>
Thu, 18 Dec 2008 22:55:58 +0000 (15:55 -0700)
committerEric Blake <ebb9@byu.net>
Thu, 18 Dec 2008 22:55:58 +0000 (15:55 -0700)
* doc/autoconf.texi (Redefined M4 Macros) <m4_dumpdef>: Document
ramification of M4 1.4.x's inability to pass builtin tokens
through text macros.
(Evaluation Macros) <m4_curry>: Likewise.
* tests/m4sugar.at (m4@&t@_defn): Enhance test.
* NEWS: Mention subtle change in m4_dumpdef semantics.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
NEWS
doc/autoconf.texi
tests/m4sugar.at

index 86c6c4b629eee3e5bbb0520535741cf8671b62cb..c1d367a6f1326763eff31e8b7417d70789b9cc7b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2008-12-18  Eric Blake  <ebb9@byu.net>
 
+       Mention limitation of M4 1.4.x on builtin tokens.
+       * doc/autoconf.texi (Redefined M4 Macros) <m4_dumpdef>: Document
+       ramification of M4 1.4.x's inability to pass builtin tokens
+       through text macros.
+       (Evaluation Macros) <m4_curry>: 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)
        <m4_version_prereq>: Add documentation.
diff --git a/NEWS b/NEWS
index 2e7fa1e34396a544f634cb56c114c9e411c478b2..30ac715a379c8cea2867d2db50b8ae5809ee870f 100644 (file)
--- 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
index aeeb38817ddffd6b565c9ff114c5074f4db7831a..1e211a19e0df5e93110df85e86361291b7db8539 100644 (file)
@@ -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{})
index 36787fc0485539b0ed125608dc1a4af888a64a09..8a538f0ad709cdad67649d94faf8131226c1367a 100644 (file)
@@ -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