[Top][All Lists]

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

Re: bad define semantics in GNU m4

From: Gary V. Vaughan
Subject: Re: bad define semantics in GNU m4
Date: Mon, 07 Jul 2003 21:52:51 +0100
User-agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.3) Gecko/20030312

Paul Eggert wrote:
Richard Stallman <address@hidden> writes:

   How about if we modify m4 so that it disables incompatibilities with
   POSIX if the POSIXLY_CORRECT environment variable is set?  This is
   what the GNU coding standards suggest.

That is an ok solution.  I had thought that an option would be more
convenient as an interface, but your argument in favor of using the
envvar seems to make sense.

OK, here is a proposed patch against CVS m4 to implement this.  It
suppresses all the POSIX incompatibilities that I found in m4, if
POSIXLY_CORRECT is set.  Unfortunately I can't easily test this, as
CVS m4 requires a CVS libtool version that I don't have, and the
bootstrap fails with the latest released libtool.

2003-07-03  Gary V. Vaughan  <address@hidden>

        * tests/builtins.at: New test for smashed definitions.

2003-07-03  Paul Eggert  <address@hidden> and
            Gary V. Vaughan  <address@hidden>
        Conform to POSIX if the POSIXLY_CORRECT environment is set.
        --traditional `define' now smashes all the definitions.
        * NEWS: Explain this.
        * doc/m4.texinfo (Defn): `defn' takes any number of arguments.
        (Extensions): Explain that extensions that are incompatible with
        POSIX are disabled if POSIXLY_CORRECT is set.
        (Incompatibilities): Remove.
        (Define, Other Incompat): Explain difference
        between GNU and POSIX behavior of define, pushdef, popdef.
        * m4/m4.c (m4_get_posixly_correct_opt): New undef.
        * m4/m4module.h (m4_context_opt_bit_table): Add POSIXLY_CORRECT entry.
        * m4/m4private.h (M4_OPT_POSIXLY_CORRECT_BIT): New macro.
        (m4_get_posixly_correct_opt): New macro.
        * m4/m4macro.c (m4_process_macro): Disable $10, $abc etc. if
        * modules/m4.c (builtin_functions): defn now takes any number of args.
        (M4BUILTIN_HANDLER (define)): Smash all the definitions if
        (M4BUILTIN_HANDLER (defn)): Allow any number of arguments.
        (M4BUILTIN_HANDLER (undivert)): Do not allow nonnumeric arguments
        * src/main.c (main): Set posixly-correct behavior if either
        POSIXLY_CORRECT is set, or if -G is given.


If there are no objections, I'll test and apply this when I've recovered from the gastric flu that has put me out of circulation for the last week or so.

  ())_. 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]