]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* m4sugar.m4 (m4_location): When using its value, don't use
authorAkim Demaille <akim@epita.fr>
Fri, 3 Nov 2000 15:21:14 +0000 (15:21 +0000)
committerAkim Demaille <akim@epita.fr>
Fri, 3 Nov 2000 15:21:14 +0000 (15:21 +0000)
`m4_defn', since m4_location is not a variable, it's a macro which
expands to __file__:__line__.
* tests/m4sugar.at (m4_warn): New test.

ChangeLog
lib/m4sugar/m4sugar.m4
m4sugar.m4
tests/m4sugar.at

index ba8c22d550814eb15d3bc689a45e0098d31b7d4a..8384682742b475584d183f3f85250a78f6ee41e4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2000-11-03  Akim Demaille  <akim@epita.fr>
+
+       * m4sugar.m4 (m4_location): When using its value, don't use
+       `m4_defn', since m4_location is not a variable, it's a macro which
+       expands to __file__:__line__.
+       * tests/m4sugar.at (m4_warn): New test.
+
 2000-11-03  Akim Demaille  <akim@epita.fr>
 
        * tests/tools.at (unexpanded macros): Strengthen.
index c9889e09410fe5434688328880095a6d16dbce9d..7ebd79b4af6f593fde37957ff13a0d96fc2526dd 100644 (file)
@@ -1025,7 +1025,7 @@ m4_define([_m4_expansion_stack_dump],
        [m4_errprint(m4_defn([_m4_expansion_stack]))dnl
 m4_popdef([_m4_expansion_stack])dnl
 _m4_expansion_stack_dump()],
-       [m4_errprint(m4_defn([m4_location])[: the top level])])])
+       [m4_errprint(m4_location[: the top level])])])
 
 
 # _m4_defun_pro(MACRO-NAME)
@@ -1068,7 +1068,7 @@ m4_provide([$1])dnl
 # macros that are not involved in ordering constraints, to save m4
 # processing.
 m4_define([m4_defun],
-[m4_define([m4_location($1)], m4_defn([m4_location]))dnl
+[m4_define([m4_location($1)], m4_location)dnl
 m4_define([$1],
           [_m4_defun_pro([$1])$2[]_m4_defun_epi([$1])])])
 
@@ -1078,7 +1078,7 @@ m4_define([$1],
 # As m4_defun, but issues the EXPANSION only once, and warns if used
 # several times.
 m4_define([m4_defun_once],
-[m4_define([m4_location($1)], m4_defn([m4_location]))dnl
+[m4_define([m4_location($1)], m4_location)dnl
 m4_define([$1],
           [m4_provide_ifelse([$1],
                              [m4_warn([syntax], [$1 invoked multiple times])],
@@ -1128,7 +1128,7 @@ m4_define([m4_before],
 #   it passes to `AC_LANG_COMPILER(C)'.
 m4_define([_m4_require],
 [m4_pushdef([_m4_expansion_stack],
-            m4_defn([m4_location])[: $1 is required by...])dnl
+            m4_location[: $1 is required by...])dnl
 ifdef([_m4_expanding($1)],
       [m4_fatal([m4_require: circular dependency of $1])])dnl
 ifndef([_m4_divert_dump],
index c9889e09410fe5434688328880095a6d16dbce9d..7ebd79b4af6f593fde37957ff13a0d96fc2526dd 100644 (file)
@@ -1025,7 +1025,7 @@ m4_define([_m4_expansion_stack_dump],
        [m4_errprint(m4_defn([_m4_expansion_stack]))dnl
 m4_popdef([_m4_expansion_stack])dnl
 _m4_expansion_stack_dump()],
-       [m4_errprint(m4_defn([m4_location])[: the top level])])])
+       [m4_errprint(m4_location[: the top level])])])
 
 
 # _m4_defun_pro(MACRO-NAME)
@@ -1068,7 +1068,7 @@ m4_provide([$1])dnl
 # macros that are not involved in ordering constraints, to save m4
 # processing.
 m4_define([m4_defun],
-[m4_define([m4_location($1)], m4_defn([m4_location]))dnl
+[m4_define([m4_location($1)], m4_location)dnl
 m4_define([$1],
           [_m4_defun_pro([$1])$2[]_m4_defun_epi([$1])])])
 
@@ -1078,7 +1078,7 @@ m4_define([$1],
 # As m4_defun, but issues the EXPANSION only once, and warns if used
 # several times.
 m4_define([m4_defun_once],
-[m4_define([m4_location($1)], m4_defn([m4_location]))dnl
+[m4_define([m4_location($1)], m4_location)dnl
 m4_define([$1],
           [m4_provide_ifelse([$1],
                              [m4_warn([syntax], [$1 invoked multiple times])],
@@ -1128,7 +1128,7 @@ m4_define([m4_before],
 #   it passes to `AC_LANG_COMPILER(C)'.
 m4_define([_m4_require],
 [m4_pushdef([_m4_expansion_stack],
-            m4_defn([m4_location])[: $1 is required by...])dnl
+            m4_location[: $1 is required by...])dnl
 ifdef([_m4_expanding($1)],
       [m4_fatal([m4_require: circular dependency of $1])])dnl
 ifndef([_m4_divert_dump],
index e7df9e19292654f2479b8bcf0d12ad661a1a202d..e2763816e283d8d6644edc8408ec1ea03df0afa1 100644 (file)
@@ -49,6 +49,48 @@ AT_DATA(expout,
 First, second , third, [,quoted]
 ]])
 
-AT_CHECK([../autoconf --autoconf-dir .. -l $at_srcdir -o-], 0, expout)
+AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir -o-], 0, expout)
+
+AT_CLEANUP()
+
+
+
+## --------- ##
+## m4_warn.  ##
+## --------- ##
+
+AT_SETUP([m4_warn])
+
+# m4_text_wrap is used to display the help strings.  Also, check that
+# commas are not swallowed.  This can easily happen because of
+# m4-listification.
+
+AT_DATA(configure.in,
+[[m4_warn([foo],  [foo])
+m4_warn([bar],    [bar])
+m4_warn([syntax], [syntax])
+]])
+
+AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir -o-],
+         0, [],
+[configure.in:3: warning: syntax
+])
+
+AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir -o- -Wall],
+         0, [],
+[configure.in:1: warning: foo
+configure.in:2: warning: bar
+configure.in:3: warning: syntax
+])
+
+AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir -o- -Wnone,bar],
+         0, [],
+[configure.in:2: warning: bar
+])
+
+AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir -o- -Wnone,bar,error],
+         1, [],
+[configure.in:2: error: bar
+])
 
 AT_CLEANUP()