summaryrefslogtreecommitdiff
path: root/modules/gnu.c
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2008-08-23 22:51:03 -0600
committerEric Blake <ebb9@byu.net>2008-08-23 22:51:03 -0600
commitc70fbd65dd345fa4c96b9ca631d70424c644cbc7 (patch)
tree52d9ad42c2d31082cd1ad37ef2dbac7e9a558723 /modules/gnu.c
parent8eb70fbb1969717d7cfefea93ee9f117fd3933cd (diff)
downloadm4-c70fbd65dd345fa4c96b9ca631d70424c644cbc7.tar.gz
Allow debugmode control over whether defn(undef) warns.
* ltdl/m4/gnulib-cache.m4: Import verify module. * m4/m4module.h (M4_DEBUG_TRACE_DEREF, M4_DEBUG_TRACE_INITIAL): New values. (M4_DEBUG_TRACE_VERBOSE, M4_DEBUG_TRACE_DEFAULT): Adjust. * m4/m4.c (m4_create): Start with debugmode = d. * src/main.c (usage): Mention this. (main): Let -E impact debug mode. * m4/utility.c (m4_symbol_value_lookup): Squelch undefined warning if flag is clear. * modules/gnu.c (builtin, inder): Likewise. * m4/debug.c (m4_debug_decode): Parse new mode. * src/freeze.c (produce_debugmode_state): Accomodate new mode. * doc/m4.texinfo (Debugging options): Mention change in the default behavior. (Debugmode): Mention new flag d. (Operation modes): Mention interaction with -E. (Undefine, Defn, Pushdef, Indir, Builtin, Dumpdef): Document and test its effect. * tests/options.at (--debugmode): Update tests. * tests/freeze.at (reloading debugmode): Likewise. * NEWS: Document this. Reported by Ralf Wildenhues; without this patch, M4 1.6+ would be incompatible with Autoconf 2.62. Signed-off-by: Eric Blake <ebb9@byu.net>
Diffstat (limited to 'modules/gnu.c')
-rw-r--r--modules/gnu.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/modules/gnu.c b/modules/gnu.c
index 2e960305..74e1c4a7 100644
--- a/modules/gnu.c
+++ b/modules/gnu.c
@@ -424,14 +424,14 @@ M4BUILTIN_HANDLER (builtin)
len = M4ARGLEN (2);
if (len == strlen (name))
value = m4_builtin_find_by_name (NULL, name);
- if (value == NULL)
- m4_warn (context, 0, me, _("undefined builtin %s"),
- quotearg_style_mem (locale_quoting_style, name, len));
- else
+ if (value)
{
m4_push_builtin (context, obs, value);
free (value);
}
+ else if (m4_is_debug_bit (context, M4_DEBUG_TRACE_DEREF))
+ m4_warn (context, 0, me, _("undefined builtin %s"),
+ quotearg_style_mem (locale_quoting_style, name, len));
}
else
m4_warn (context, 0, me, _("invalid macro name ignored"));
@@ -443,8 +443,11 @@ M4BUILTIN_HANDLER (builtin)
if (len == strlen (name))
value = m4_builtin_find_by_name (NULL, name);
if (value == NULL)
- m4_warn (context, 0, me, _("undefined builtin %s"),
- quotearg_style_mem (locale_quoting_style, name, len));
+ {
+ if (m4_is_debug_bit (context, M4_DEBUG_TRACE_DEREF))
+ m4_warn (context, 0, me, _("undefined builtin %s"),
+ quotearg_style_mem (locale_quoting_style, name, len));
+ }
else
{
const m4_builtin *bp = m4_get_symbol_value_builtin (value);
@@ -692,8 +695,11 @@ M4BUILTIN_HANDLER (indir)
m4_symbol *symbol = m4_symbol_lookup (M4SYMTAB, name, len);
if (symbol == NULL)
- m4_warn (context, 0, me, _("undefined macro %s"),
- quotearg_style_mem (locale_quoting_style, name, len));
+ {
+ if (m4_is_debug_bit (context, M4_DEBUG_TRACE_DEREF))
+ m4_warn (context, 0, me, _("undefined macro %s"),
+ quotearg_style_mem (locale_quoting_style, name, len));
+ }
else
{
m4_macro_args *new_argv;