m4-patches
[Top][All Lists]
Advanced

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

Re: 29-fyi-verbose-fatal.patch


From: Gary V. Vaughan
Subject: Re: 29-fyi-verbose-fatal.patch
Date: Mon, 3 Sep 2001 19:57:06 +0100
User-agent: Mutt/1.3.21i

On Mon, Sep 03, 2001 at 05:11:23PM +0200, Akim Demaille wrote:
> BTW, I don't like CAPITALS for enums, so I'm tempted to lowercase all of
> 
>       /* Operation modes for m4_lookup_symbol ().  */
>       typedef enum
>       {
>               M4_SYMBOL_LOOKUP,
>               M4_SYMBOL_INSERT,
>               M4_SYMBOL_DELETE,
>               M4_SYMBOL_PUSHDEF,
>               M4_SYMBOL_POPDEF,
>               M4_SYMBOL_IGNORE
>       } m4_symbol_lookup;
> 
> but I'd like your approval first.

I'd rather not, because I think that constants (be they #defined or
enumerated) should be easily distinguishable from variable names.  As
a matter of fact, I think the m4_symbol_lookup design is screwy, I
plan to rewrite it as 5 functions at some point -- one for each piece
of functionality the current function swallows.  I would have done it
when I rewrote the symbol table, but I wasn't sure how to disentagle
the M4_SYMBOL_IGNORE instances, and though it best to work the bugs
out of what has been changed so far before another source quake ;-)

> now let's dive into:
> 
>     10. ./tools.at:470: testing autoupdate...
>     ./tools.at:491: autoupdate
>     --- -     Mon Sep  3 16:59:42 2001
>     +++ at-stderr     Mon Sep  3 16:59:42 2001
>     @@ -1,2 +1,1238 @@
>     +/usr/local/bin/m4: /tmp/au4676.32573/disable.m4: 1: INTERNAL ERROR: 
> Attempt to delete non-existant symbol: <<m4_split>>
>     +/usr/local/bin/m4: /tmp/au4676.32573/disable.m4: 2: INTERNAL ERROR: 
> Attempt to delete non-existant symbol: AC_AIX
>     +/usr/local/bin/m4: /tmp/au4676.32573/disable.m4: 3: INTERNAL ERROR: 
> Attempt to delete non-existant symbol: AC_ARG_ENABLE
>     +/usr/local/bin/m4: /tmp/au4676.32573/disable.m4: 4: INTERNAL ERROR: 
> Attempt to delete non-existant symbol: AC_ARG_PROGRAM
>     +/usr/local/bin/m4: /tmp/au4676.32573/disable.m4: 5: INTERNAL ERROR: 
> Attempt to delete non-existant symbol: AC_ARG_VAR
>     +/usr/local/bin/m4: /tmp/au4676.32573/disable.m4: 6: INTERNAL ERROR: 
> Attempt to delete non-existant symbol: AC_ARG_WITH
> 
> :(
> 
> Ah, OK, I have it: it very simple:
> 
> src/ace/tests % echo 'undefine(foo)' | m4                            17:03 
> remo
> m4: stdin: 1: INTERNAL ERROR: Attempt to delete non-existant symbol: foo

Oops.  Unintentional, I assure you!

> I must say that I *much* prefer this than the previous behavior, which
> allows undefining non existant stuff.  So I'm in favor of keeping this
> feature.  But be aware that this is incompatible.

Unfortunately, it is also incompatible with at least Solaris' 2 m4
implementations too =(O|  I agree that it makes for more robust code
though... perhaps we could enable it from the command line or and/or
argument to debugmode.  OTOH, I guess that as long as we turn it off
with --traditional and/or some runtime mechanism, it might be wise to
leave it enabled by default?

> BTW, then, it would make sense to have failures for:
> 
> src/ace/tests % echo 'defn(foo)' | m4                                17:04 
> remo
> 
> src/ace/tests % echo 'popdef(foo)' | m4                              17:06 
> remo
> 
> src/ace/tests %                                                      17:06 
> remo

That's odd.  I would have expected each of them to end up in the same
code in symtyab.h, and already exhibit similar behaviour.  But you're
right, whatever we decide to do with undefine should be applied in
equal measure to the others.

>       Avoid using `default' in switch, as it hides useful compiler
>       warnings when a case is forgotten.

That is a nice idiom that I hadn't actually given though to before.
Cool, thanks.  DOes gcc warn in this case without additional -W
options btw?

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]