m4-patches
[Top][All Lists]
Advanced

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

Re: 16-fyi-bad-argc-interface.patch


From: Gary V. Vaughan
Subject: Re: 16-fyi-bad-argc-interface.patch
Date: Sat, 13 Oct 2001 15:50:39 +0100
User-agent: Mutt/1.3.16i

On Sat, Oct 13, 2001 at 10:57:11AM +0200, Akim Demaille wrote:
> Index: ChangeLog
> from  Akim Demaille  <address@hidden>
> 
>       * m4/macro.c (expand_macro): Let m4_bad_argc handle the cases
> [[snip]]
> Index: m4/macro.c
> +++ m4/macro.c Sat, 13 Oct 2001 09:22:01 +0200 akim
> @@ -294,14 +294,8 @@ ERROR: Recursion limit of %d exceeded, u
> 
>    expansion = m4_push_string_init ();
>    {
> -    boolean bad_args = FALSE;
> -
> -    /* If argument limits are set for this builtin, check them and
> -       only call the builtin handler if the check passes.  */
> -    if ((SYMBOL_MIN_ARGS (symbol) > 0) || (SYMBOL_MAX_ARGS (symbol) > 0))
> -      bad_args = m4_bad_argc (argv[0], argc, SYMBOL_MIN_ARGS (symbol),
> -                          SYMBOL_MAX_ARGS (symbol));
> -    if (!bad_args)
> +    if (!m4_bad_argc (argc, argv,
> +                   SYMBOL_MIN_ARGS (symbol), SYMBOL_MAX_ARGS (symbol)))
>        m4_call_macro (symbol, argc, argv, expansion);
>    }
>    expanded = m4_push_string_finish ();
> [[snip]]

I fine with this, except that I had wanted to save on the overhead of a
function call when no checks were necessary... this deep in the inner
loop it must make a difference.

Why don't we have a `M4_BAD_ARGC' macro, that only calls the func if at
least one of the range limits is non-negative?

Cheers,
        Gary.
-- 
  ())_. Gary V. Vaughan     gary@(oranda.demon.co.uk|gnu.org)
  ( '/  Research Scientist  http://www.oranda.demon.co.uk       ,_())____
  / )=  GNU Hacker          http://www.gnu.org/software/libtool  \'      `&
`(_~)_  Tech' Author        http://sources.redhat.com/autobook   =`---d__/



reply via email to

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