m4-patches
[Top][All Lists]
Advanced

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

Re: more doc merges


From: Eric Blake
Subject: Re: more doc merges
Date: Wed, 30 Aug 2006 21:20:59 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.5) Gecko/20060719 Thunderbird/1.5.0.5 Mnenhy/0.7.4.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Eric Blake on 8/30/2006 7:33 AM:
> 
> 2006-08-30  Eric Blake  <address@hidden>
> 
>       * doc/m4.texinfo (Undefine, Defn, Pushdef): More doc merges from
>       the branch.

Another round (including a fix for this morning's typo, that broke the
testsuite).  I noticed that undefine(`no_such') was causing a hard
failure, where it was just a warning on the branch, and not permitted to
fail by POSIX.  But converting from m4_error to m4_warn was not trivial,
when I had to remember to change the string, so I factored the string
"Warning: " into m4_warn instead, turning this into somewhat of a big patch.

2006-08-30  Eric Blake  <address@hidden>

        * m4/utility.c (m4_warn): Factor "Warning" out of messages into
        here.
        (m4_bad_argc, m4_numeric_arg): Update all callers.
        * m4/macro.c (m4_macro_call): Likewise.
        * doc/m4.texinfo (Defn, Pushdef): Fix typos in last commit.
        (Indir, Builtin, Ifdef): More doc merges.
        (Loops): Mention that documenting foreach would be nice.
        (Macro Arguments, Defn, Builtin, Ifdef, Ifelse, Changesyntax)
        (Include, Eval, Location, M4exit): s/input.m4/stdin/.
        * modules/gnu.c (indir, builtin): Warn, not error, on undefined.
        (substitute, syncoutput): Update all m4_warn callers.
        * modules/m4.c (undefine, popdef, m4_dump_symbols, defn)
        (traceon, traceoff): Make warning message consistent.
        (define, pushdef): Update all m4_warn callers.
        * tests/generate.awk: Choose file name so that documentation can
        show command-line behavior.
        * tests/builtins.at (define): Update to new wording.
        * tests/macros.at (pushdef/popdef): Likewise.
        * tests/freeze.at (loading format 1): Likewise.
        * tests/modules.at (AT_CHECK_M4_MODTEST): Likewise.

- --
Life is short - so eat dessert first!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE9lWb84KuGfSFAYARAqVuAKCUwlIvHp+XI2cHbgvOwe1O1ZloQgCePewM
Nrjq8zLKxVHsk9+HtMhnBiY=
=rKli
-----END PGP SIGNATURE-----
Index: doc/m4.texinfo
===================================================================
RCS file: /sources/m4/m4/doc/m4.texinfo,v
retrieving revision 1.38
diff -u -p -r1.38 m4.texinfo
--- doc/m4.texinfo      30 Aug 2006 13:35:20 -0000      1.38
+++ doc/m4.texinfo      31 Aug 2006 03:20:24 -0000
@@ -1202,12 +1202,12 @@ defined macros, there is no check of the
 @example
 $ @kbd{m4}
 index(`abc')
address@hidden:input.m4:1: Warning: index: too few arguments: 1 < 2
address@hidden:stdin:1: Warning: index: too few arguments: 1 < 2
 @result{}0
 index(`abc',)
 @result{}0
 index(`abc', `b', `ignored')
address@hidden:input.m4:3: Warning: index: extra arguments ignored: 3 > 2
address@hidden:stdin:3: Warning: index: extra arguments ignored: 3 > 2
 @result{}1
 @end example
 
@@ -1256,7 +1256,7 @@ It is an error if the end of file occurs
 @example
 define(
 ^D
address@hidden:input.m4:1: ERROR: end of file in argument list
address@hidden:stdin:1: ERROR: end of file in argument list
 @end example
 
 @node Quoting Arguments
@@ -1784,7 +1784,7 @@ of expected contexts can sometimes trigg
 
 @example
 define(defn(`divnum'), `cannot redefine a builtin token')
address@hidden:input.m4:1: Warning: define: invalid macro name ignored
address@hidden:stdin:1: Warning: define: invalid macro name ignored
 @result{}
 divnum
 @result{}0
@@ -1797,14 +1797,14 @@ concatenate multiple macros into one.
 
 @example
 defn(`foo')
address@hidden:input.m4:1: Warning: defn: undefined macro: foo
address@hidden:stdin:1: Warning: defn: undefined macro `foo'
 @result{}
 define(`foo', `a')
 @result{}
 define(`bar', defn(`foo', `divnum'))
address@hidden
address@hidden
 define(`blah', defn(`divnum', `foo'))
address@hidden
address@hidden
 bar
 @result{}a0
 blah
@@ -1856,7 +1856,6 @@ pushdef(`foo', `Expansion four.')
 popdef(`foo')
 @result{}
 foo
address@hidden one.
 @result{}Expansion three.
 popdef(`foo', `foo')
 @result{}
@@ -1977,16 +1976,19 @@ m4_renamesyms(`^m4_m4(\w*)$', `m4_\1', `
 @cindex indirect call of macros
 @cindex call of macros, indirect
 @cindex macros, indirect call of
address@hidden GNU extensions
address@hidden @acronym{GNU} extensions
+Any macro can be called indirectly with @code{indir}:
+
 @deffn {Builtin (gnu)} indir (@var{name}, @dots{})
-Any macro can be called indirectly with @code{indir}, which results in a
-call to the macro @var{name}, which is passed the rest of the arguments.
+Results in a call to the macro @var{name}, which is passed the
+rest of the arguments.  If @var{name} is not defined, an error message
+is printed, and the expansion is void.
 
-The macro @code{defn} is recognized only with parameters.
+The macro @code{indir} is recognized only with parameters.
 @end deffn
 
-This can be used to call macros with computed or with ``illegal'' names
-(@code{define} allows such names to be defined):
+This can be used to call macros with computed or ``invalid''
+names (@code{define} allows such names to be defined):
 
 @example
 define(`$$internal$macro', `Internal macro (name `$0')')
@@ -1997,7 +1999,7 @@ indir(`$$internal$macro')
 @result{}Internal macro (name $$internal$macro)
 @end example
 
-The point here is that larger macro packages can have private macros
+The point is, here, that larger macro packages can have private macros
 defined, that will not be called by accident.  They can @emph{only} be
 called through the builtin @code{indir}.
 
@@ -2007,45 +2009,115 @@ called through the builtin @code{indir}.
 @cindex indirect call of builtins
 @cindex call of builtins, indirect
 @cindex builtins, indirect call of
address@hidden GNU extensions
address@hidden @acronym{GNU} extensions
+Builtin macros can be called indirectly with @code{builtin}:
+
 @deffn {Builtin (gnu)} builtin (@var{name}, @dots{})
-Builtin macros can be called indirectly with @code{builtin}, which
-results in a call to the builtin @var{name}, which is passed the rest of
-the arguments.  This can be used, if @var{name} has been given another
-definition that has covered the original.
+Results in a call to the builtin @var{name}, which is passed the
+rest of the arguments.  If @var{name} does not name a builtin, a warning
+message is printed, and the expansion is void.
 
 The macro @code{builtin} is recognized only with parameters.
 @end deffn
 
+This can be used even if @var{name} has been given another definition
+that has covered the original, or been undefined so that no macro
+maps to the builtin.
+
address@hidden
+pushdef(`define', `hidden')
address@hidden
+undefine(`undefine')
address@hidden
+define(`foo', `bar')
address@hidden
+foo
address@hidden
+builtin(`define', `foo', `BAR')
address@hidden
+foo
address@hidden
+undefine(`foo')
address@hidden(foo)
+foo
address@hidden
+builtin(`undefine', `foo')
address@hidden
+foo
address@hidden
address@hidden example
+
+The @var{name} argument only matches the original name of the builtin,
+even when the @option{--prefix-builtins} option (or @option{-P},
address@hidden m4}) is in effect.  This is different from @code{indir},
+which only tracks current macro names.
+
address@hidden options: -P
address@hidden
+$ @kbd{m4 -P}
+m4_builtin(`divnum')
address@hidden
+m4_builtin(`m4_divnum')
address@hidden:stdin:2: Warning: m4_builtin: undefined builtin `m4_divnum'
address@hidden
+m4_indir(`divnum')
address@hidden:stdin:3: Warning: m4_indir: undefined macro `divnum'
address@hidden
+m4_indir(`m4_divnum')
address@hidden
address@hidden example
+
+Note that @code{indir} and @code{builtin} can be used to invoke builtins
+without arguments, even when they normally require parameters to be
+recognized; but it will provoke a warning, and the expansion will behave
+as though empty strings had been passed as the required arguments.
+
address@hidden
+builtin
address@hidden
+builtin()
address@hidden:stdin:2: Warning: builtin: undefined builtin `'
address@hidden
+builtin(`builtin')
address@hidden:stdin:3: Warning: builtin: too few arguments: 0 < 1
address@hidden
+builtin(`builtin',)
address@hidden:stdin:4: Warning: builtin: undefined builtin `'
address@hidden
+indir(`index')
address@hidden:stdin:5: Warning: index: too few arguments: 0 < 2
address@hidden
address@hidden example
+
 @node Symbols
 @section Getting the defined macro names
 
 @cindex macro names
address@hidden GNU extensions
-The name of the currently defined macro can be accessed by
address@hidden @acronym{GNU} extensions
+The name of the currently defined macros can be accessed by
 @code{symbols}:
 
address@hidden {Builtin (gnu)} symbols
address@hidden {Builtin (gnu)} symbols (@dots{})
address@hidden {Builtin (gnu)} symbols (@dots{})
 Without arguments, @samp{symbols} expands to a sorted list of quoted
-strings.  This contrasts with @code{dumpdef} which output can not be
-accessed by @code{m4} programs.
+strings, separated by commas.  This contrasts with @code{dumpdef}
+(@pxref{Dumpdef}), whose output cannot be accessed by @code{m4}
+programs.
 
 When given arguments, @code{symbols} returns the sorted subset of the
-symbols currently defined:
+symbols currently defined.
address@hidden deffn
 
 @example
 symbols(`ifndef', `ifdef', `define', `undef')
 @result{}define,ifdef
 @end example
address@hidden deffn
 
 @node Conditionals
 @chapter Conditionals, loops, and recursion
 
 Macros, expanding to plain text, perhaps with arguments, are not quite
 enough.  We would like to have macros expand to different things, based
-on decisions taken at run-time.  E.g., we need some kind of conditionals.
+on decisions taken at run-time.  For that, we need some kind of conditionals.
 Also, we would like to have some kind of loop construct, so we could do
 something a number of times, or while some condition is true.
 
@@ -2059,10 +2131,11 @@ something a number of times, or while so
 @section Testing macro definitions
 
 @cindex conditionals
address@hidden {Builtin (m4)} ifdef (@var{name}, @var{string-1}, @w{opt 
@var{string-2})}
 There are two different builtin conditionals in @code{m4}.  The first is
address@hidden, which test whether a macro is defined or not.  If
address@hidden is defined as a macro, @code{ifdef} expands to
address@hidden:
+
address@hidden {Builtin (m4)} ifdef (@var{name}, @var{string-1}, 
@ovar{string-2})
+If @var{name} is defined as a macro, @code{ifdef} expands to
 @var{string-1}, otherwise to @var{string-2}.  If @var{string-2} is
 omitted, it is taken to be the empty string (according to the normal
 rules).
@@ -2077,6 +2150,9 @@ define(`foo', `')
 @result{}
 ifdef(`foo', ``foo' is defined', ``foo' is not defined')
 @result{}foo is defined
+ifdef(`no_such_macro', `yes', `no', `extra argument')
address@hidden:stdin:4: Warning: ifdef: extra arguments ignored: 4 > 3
address@hidden
 @end example
 
 @node Ifelse
@@ -2100,7 +2176,7 @@ warning about missing arguments is never
 ifelse(`some comments')
 @result{}
 ifelse(`foo', `bar')
address@hidden:input.m4:2: Warning: ifelse: too few arguments: 2 < 3
address@hidden:stdin:2: Warning: ifelse: too few arguments: 2 < 3
 @result{}
 @end example
 
@@ -2249,6 +2325,13 @@ enough for general use. They lack even b
 like start value less than final value, and the first argument not being
 a name.  Correcting these errors are left as an exercise to the reader.
 
address@hidden FIXME - it would be nice to introduce foreach here, and even
address@hidden give an example like this for finding defined macros that meet
address@hidden a certain pattern (see examples/foreach.m4):
address@hidden define(`quote', ``$@'')
address@hidden foreach(`macro', (quote(symbols)),
address@hidden         `regexp(macro, `.*_.*', ``\&',')')
+
 @node Debugging
 @chapter How to debug macros and input
 
@@ -2823,7 +2906,7 @@ With @code{changesyntax} we can modify t
 define(`test.1', `TEST ONE')
 @result{}
 __file__
address@hidden
address@hidden
 changesyntax(`O_', `W.')
 @result{}
 __file__
@@ -3092,7 +3175,7 @@ only when given arguments.
 @example
 include(`n')
 @result{}
address@hidden:input.m4:1: include: cannot open `n': No such file or directory
address@hidden:stdin:1: include: cannot open `n': No such file or directory
 sinclude(`n')
 @result{}
 @end example
@@ -4076,7 +4159,7 @@ square(square(5)+1)
 define(`foo', `666')
 @result{}
 eval(`foo / 6')
address@hidden:input.m4:7: eval: bad expression: foo / 6
address@hidden:stdin:7: eval: bad expression: foo / 6
 @result{}
 eval(foo/6)
 @result{}111
@@ -4317,7 +4400,7 @@ the current input line number in that fi
 @example
 errprint(`m4:'__file__:__line__: `Input error
 ')
address@hidden:input.m4:1: Input error
address@hidden:stdin:1: Input error
 @result{}
 @end example
 @end deffn
@@ -4341,7 +4424,7 @@ define(`fatal_error',
 ')m4exit(1)')
 @result{}
 fatal_error(`This is a BAD one, buster')
address@hidden:input.m4:4: fatal error: This is a BAD one, buster
address@hidden:stdin:4: fatal error: This is a BAD one, buster
 @end example
 
 After this macro call, @code{m4} will exit with exit code 1.  This macro
Index: m4/macro.c
===================================================================
RCS file: /sources/m4/m4/m4/macro.c,v
retrieving revision 1.50
diff -u -p -r1.50 macro.c
--- m4/macro.c  25 Aug 2006 22:06:42 -0000      1.50
+++ m4/macro.c  31 Aug 2006 03:20:24 -0000
@@ -332,8 +332,8 @@ m4_macro_call (m4 *context, m4_symbol *s
     }
   else if (m4_is_symbol_placeholder (symbol))
     {
-      m4_warn (context, 0, _("\
-Warning: %s: builtin `%s' requested by frozen file not found"),
+      m4_warn (context, 0,
+              _("%s: builtin `%s' requested by frozen file not found"),
               M4ARG (0), m4_get_symbol_placeholder (symbol));
     }
   else
Index: m4/utility.c
===================================================================
RCS file: /sources/m4/m4/m4/utility.c,v
retrieving revision 1.46
diff -u -p -r1.46 utility.c
--- m4/utility.c        28 Aug 2006 12:48:54 -0000      1.46
+++ m4/utility.c        31 Aug 2006 03:20:24 -0000
@@ -24,6 +24,7 @@
 
 #include "m4private.h"
 #include "verror.h"
+#include "xvasprintf.h"
 
 
 static const char * skip_space (m4 *, const char *);
@@ -44,14 +45,14 @@ m4_bad_argc (m4 *context, int argc, m4_s
 {
   if (argc - 1 < min)
     {
-      m4_warn (context, 0, _("Warning: %s: too few arguments: %d < %d"),
+      m4_warn (context, 0, _("%s: too few arguments: %d < %d"),
               M4ARG (0), argc - 1, min);
       return ! side_effect;
     }
 
   if (argc - 1 > max)
     {
-      m4_warn (context, 0, _("Warning: %s: extra arguments ignored: %d > %d"),
+      m4_warn (context, 0, _("%s: extra arguments ignored: %d > %d"),
               M4ARG (0), argc - 1, max);
     }
 
@@ -81,7 +82,7 @@ m4_numeric_arg (m4 *context, int argc, m
       || (*valuep = strtol (skip_space (context, M4ARG (arg)), &endp, 10),
          *skip_space (context, endp) != 0))
     {
-      m4_warn (context, 0, _("Warning: %s: argument %d non-numeric: %s"),
+      m4_warn (context, 0, _("%s: argument %d non-numeric: %s"),
               M4ARG (0), arg - 1, M4ARG (arg));
       return false;
     }
@@ -129,10 +130,10 @@ m4_error (m4 *context, int status, int e
 
 /* Issue a warning, if they are not being suppressed.  The message is
    printf-style, based on FORMAT and any other arguments, and the
-   program name and location (if we are currently parsing an input
-   file) are automatically prepended.  If ERRNUM is non-zero, include
-   strerror output in the message.  If warnings are fatal, call exit
-   immediately, otherwise exit status is unchanged.  */
+   program name, location (if we are currently parsing an input file),
+   and "Warning:" are automatically prepended.  If ERRNUM is non-zero,
+   include strerror output in the message.  If warnings are fatal,
+   call exit immediately, otherwise exit status is unchanged.  */
 void
 m4_warn (m4 *context, int errnum, const char *format, ...)
 {
@@ -141,11 +142,15 @@ m4_warn (m4 *context, int errnum, const 
       va_list args;
       int status = EXIT_SUCCESS;
       int line = m4_get_current_line (context);
+      char *full_format = xasprintf(_("Warning: %s"), format);
       va_start (args, format);
       if (m4_get_fatal_warnings_opt (context))
        status = EXIT_FAILURE;
+      /* If the full_format failed (unlikely though that may be), at
+        least fall back on the original format.  */
       verror_at_line (status, errnum,
                      line ? m4_get_current_file (context) : NULL, line,
-                     format, args);
+                     full_format ? full_format : format, args);
+      free (full_format);
     }
 }
Index: modules/gnu.c
===================================================================
RCS file: /sources/m4/m4/modules/gnu.c,v
retrieving revision 1.52
diff -u -p -r1.52 gnu.c
--- modules/gnu.c       28 Aug 2006 12:48:54 -0000      1.52
+++ modules/gnu.c       31 Aug 2006 03:20:24 -0000
@@ -194,8 +194,7 @@ substitute (m4 *context, m4_obstack *obs
        case '7': case '8': case '9':
          ch -= '0';
          if (buf->pat.re_nsub < ch)
-           m4_warn (context, 0,
-                    _("Warning: %s: sub-expression %d not present"),
+           m4_warn (context, 0, _("%s: sub-expression %d not present"),
                     caller, ch);
          else if (buf->regs.end[ch] > 0)
            obstack_grow (obs, victim + buf->regs.start[ch],
@@ -203,8 +202,7 @@ substitute (m4 *context, m4_obstack *obs
          break;
 
        case '\0':
-         m4_warn (context, 0,
-                  _("Warning: %s: trailing \\ ignored in replacement"),
+         m4_warn (context, 0, _("%s: trailing \\ ignored in replacement"),
                   caller);
          return;
 
@@ -325,7 +323,7 @@ M4BUILTIN_HANDLER (builtin)
   bp = m4_builtin_find_by_name (NULL, name);
 
   if (bp == NULL)
-    m4_error (context, 0, 0, _("%s: undefined builtin `%s'"), M4ARG (0), name);
+    m4_warn (context, 0, _("%s: undefined builtin `%s'"), M4ARG (0), name);
   else if (!m4_bad_argc (context, argc - 1, argv + 1,
                         bp->min_args, bp->max_args,
                         (bp->flags & M4_BUILTIN_SIDE_EFFECT) != 0))
@@ -507,7 +505,7 @@ M4BUILTIN_HANDLER (indir)
   m4_symbol *  symbol = m4_symbol_lookup (M4SYMTAB, name);
 
   if (symbol == NULL)
-    m4_error (context, 0, 0, _("%s: undefined macro `%s'"), M4ARG (0), name);
+    m4_warn (context, 0, _("%s: undefined macro `%s'"), M4ARG (0), name);
   else
     m4_macro_call (context, symbol, obs, argc - 1, argv + 1);
 }
@@ -742,6 +740,5 @@ M4BUILTIN_HANDLER (syncoutput)
               && (arg[1] == 'n' || arg[1] == 'N')))
     m4_set_sync_output_opt (context, true);
   else
-    m4_warn (context, 0, _("Warning: %s: unknown directive `%s'"),
-            M4ARG (0), arg);
+    m4_warn (context, 0, _("%s: unknown directive `%s'"), M4ARG (0), arg);
 }
Index: modules/m4.c
===================================================================
RCS file: /sources/m4/m4/modules/m4.c,v
retrieving revision 1.67
diff -u -p -r1.67 m4.c
--- modules/m4.c        30 Aug 2006 04:25:42 -0000      1.67
+++ modules/m4.c        31 Aug 2006 03:20:24 -0000
@@ -180,8 +180,7 @@ M4BUILTIN_HANDLER (define)
       m4_symbol_define (M4SYMTAB, M4ARG (1), value);
     }
   else
-    m4_warn (context, 0, _("Warning: %s: invalid macro name ignored"),
-            M4ARG (0));
+    m4_warn (context, 0, _("%s: invalid macro name ignored"), M4ARG (0));
 }
 
 M4BUILTIN_HANDLER (undefine)
@@ -192,8 +191,7 @@ M4BUILTIN_HANDLER (undefine)
       const char *name = M4ARG (i);
 
       if (!m4_symbol_lookup (M4SYMTAB, name))
-       m4_warn (context, 0, _("Warning: %s: undefined macro: %s"), M4ARG (0),
-                name);
+       m4_warn (context, 0, _("%s: undefined macro `%s'"), M4ARG (0), name);
       else
        m4_symbol_delete (M4SYMTAB, name);
     }
@@ -213,8 +211,7 @@ M4BUILTIN_HANDLER (pushdef)
       m4_symbol_pushdef (M4SYMTAB, M4ARG (1), value);
     }
   else
-    m4_warn (context, 0, _("Warning: %s: invalid macro name ignored"),
-            M4ARG (0));
+    m4_warn (context, 0, _("%s: invalid macro name ignored"), M4ARG (0));
 }
 
 M4BUILTIN_HANDLER (popdef)
@@ -225,8 +222,7 @@ M4BUILTIN_HANDLER (popdef)
       const char *name = M4ARG (i);
 
       if (!m4_symbol_lookup (M4SYMTAB, name))
-       m4_warn (context, 0, _("Warning: %s: undefined macro: %s"), M4ARG (0),
-                name);
+       m4_warn (context, 0, _("%s: undefined macro `%s'"), M4ARG (0), name);
       else
        m4_symbol_popdef (M4SYMTAB, name);
     }
@@ -355,7 +351,7 @@ m4_dump_symbols (m4 *context, m4_dump_sy
              dump_symbol_CB (NULL, M4ARG (i), symbol, data);
            }
          else if (complain)
-           m4_warn (context, 0, _("Warning: %s: undefined macro: %s"),
+           m4_warn (context, 0, _("%s: undefined macro `%s'"),
                     M4ARG (0), M4ARG (i));
        }
     }
@@ -406,6 +402,7 @@ M4BUILTIN_HANDLER (dumpdef)
       else
        {
          assert (!"invalid token in builtin_dumpdef");
+         abort ();
        }
     }
 }
@@ -423,18 +420,20 @@ M4BUILTIN_HANDLER (defn)
       m4_symbol *symbol = m4_symbol_lookup (M4SYMTAB, name);
 
       if (!symbol)
-       m4_warn (context, 0, _("Warning: %s: undefined macro: %s"), M4ARG (0),
-                name);
+       m4_warn (context, 0, _("%s: undefined macro `%s'"), M4ARG (0), name);
       else if (m4_is_symbol_text (symbol))
        m4_shipout_string (context, obs, m4_get_symbol_text (symbol), 0, true);
       else if (m4_is_symbol_func (symbol))
        m4_push_builtin (m4_get_symbol_value (symbol));
       else if (m4_is_symbol_placeholder (symbol))
-       m4_warn (context, 0, _("\
-Warning: %s: builtin `%s' requested by frozen file not found"),
+       m4_warn (context, 0,
+                _("%s: builtin `%s' requested by frozen file not found"),
                 name, m4_get_symbol_placeholder (symbol));
       else
-       assert (!"Bad token data type in m4_defn");
+       {
+         assert (!"Bad token data type in m4_defn");
+         abort ();
+       }
     }
 }
 
@@ -757,8 +756,7 @@ M4BUILTIN_HANDLER (traceon)
        if (symbol != NULL)
          set_trace_CB (NULL, NULL, symbol, (char *) obs);
        else
-         m4_warn (context, 0, _("Warning: %s: undefined macro: %s"),
-                  M4ARG (0), name);
+         m4_warn (context, 0, _("%s: undefined macro `%s'"), M4ARG (0), name);
       }
 }
 
@@ -777,8 +775,7 @@ M4BUILTIN_HANDLER (traceoff)
        if (symbol != NULL)
          set_trace_CB (NULL, NULL, symbol, NULL);
        else
-         m4_warn (context, 0, _("Warning: %s: undefined macro: %s"),
-                  M4ARG (0), name);
+         m4_warn (context, 0, _("%s: undefined macro `%s'"), M4ARG (0), name);
       }
 }
 
Index: tests/builtins.at
===================================================================
RCS file: /sources/m4/m4/tests/builtins.at,v
retrieving revision 1.15
diff -u -p -r1.15 builtins.at
--- tests/builtins.at   30 Aug 2006 04:25:42 -0000      1.15
+++ tests/builtins.at   31 Aug 2006 03:20:24 -0000
@@ -42,15 +42,15 @@ AT_CHECK_M4([define.m4], 0,
 [[new value.
 hello, world.
 base value.
-]], [[m4:define.m4:1: Warning: undefine: undefined macro: macro
+]], [[m4:define.m4:1: Warning: undefine: undefined macro `macro'
 ]])
 
 AT_CHECK_M4([--traditional define.m4], 0,
 [[new value.
 macro.
 macro.
-]], [[m4:define.m4:1: Warning: undefine: undefined macro: macro
-m4:define.m4:9: Warning: popdef: undefined macro: macro
+]], [[m4:define.m4:1: Warning: undefine: undefined macro `macro'
+m4:define.m4:9: Warning: popdef: undefined macro `macro'
 ]])
 
 AT_CLEANUP
Index: tests/freeze.at
===================================================================
RCS file: /sources/m4/m4/tests/freeze.at,v
retrieving revision 1.7
diff -u -p -r1.7 freeze.at
--- tests/freeze.at     30 Aug 2006 04:25:42 -0000      1.7
+++ tests/freeze.at     31 Aug 2006 03:20:24 -0000
@@ -100,7 +100,7 @@ define 1
 my_define(bar, 4) 3
 bar
 ]],
-[[m4:input.m4:5: Warning: popdef: undefined macro: my_define
+[[m4:input.m4:5: Warning: popdef: undefined macro `my_define'
 ]])
 
 AT_CLEANUP
Index: tests/generate.awk
===================================================================
RCS file: /sources/m4/m4/tests/generate.awk,v
retrieving revision 1.17
diff -u -p -r1.17 generate.awk
--- tests/generate.awk  24 Aug 2006 00:25:04 -0000      1.17
+++ tests/generate.awk  31 Aug 2006 03:20:24 -0000
@@ -135,6 +135,7 @@ function normalize(contents,    i, lines
       gsub ("@tabchar{}", "\t", line);
       gsub ("@comment.*", "@\\&t@", line);
       gsub ("m4_", "address@hidden&address@hidden", line);
+      gsub ("stdin", "input.m4", line);
 
       # Some of the examples have improperly balanced square brackets.
       gsub ("[[]", "@<:@", line);
Index: tests/macros.at
===================================================================
RCS file: /sources/m4/m4/tests/macros.at,v
retrieving revision 1.7
diff -u -p -r1.7 macros.at
--- tests/macros.at     30 Aug 2006 04:25:42 -0000      1.7
+++ tests/macros.at     31 Aug 2006 03:20:24 -0000
@@ -137,9 +137,9 @@ hej:        `def 4.'
 hej:   `def 3.'
 hej:   `def 2.'
 hej:   `def 1.'
-m4:pushpop.m4:18: Warning: dumpdef: undefined macro: hej
-m4:pushpop.m4:20: Warning: dumpdef: undefined macro: mac2
-m4:pushpop.m4:21: Warning: popdef: undefined macro: mac2
+m4:pushpop.m4:18: Warning: dumpdef: undefined macro `hej'
+m4:pushpop.m4:20: Warning: dumpdef: undefined macro `mac2'
+m4:pushpop.m4:21: Warning: popdef: undefined macro `mac2'
 ]])
 
 AT_CLEANUP
Index: tests/modules.at
===================================================================
RCS file: /sources/m4/m4/tests/modules.at,v
retrieving revision 1.17
diff -u -p -r1.17 modules.at
--- tests/modules.at    30 Aug 2006 04:25:42 -0000      1.17
+++ tests/modules.at    31 Aug 2006 03:20:24 -0000
@@ -100,7 +100,7 @@ Dumpdef: .
 [[Test module loaded.
 test:  <test>
 Test module unloaded.
-m4:input.m4:6: Warning: dumpdef: undefined macro: test
+m4:input.m4:6: Warning: dumpdef: undefined macro `test'
 ]])
 
 AT_CLEANUP

reply via email to

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