autoconf-patches
[Top][All Lists]
Advanced

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

Re: semantique de m4 mal definie


From: Akim Demaille
Subject: Re: semantique de m4 mal definie
Date: Thu, 26 Jun 2003 10:44:18 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

Hi Marc,

Thanks for the message.

 > Le code suivant:
 > dnl $OpenBSD$
 > dnl definition stack is weird
 > define(`a', `1')dnl
 > pushdef(`a', `2')dnl
 > pushdef(`a', `3')dnl
 > pushdef(`a', `4')dnl
 > a
 > popdef(`a')dnl
 > define(`a', `5')dnl
 > a
 > popdef(`a')dnl
 > a
 > popdef(`a')dnl

 > a une semantique mal definie, d'apres Single Unix.
 > Specifiquement, que fait define lorsqu'une macro est deja definie.
 > GNU m4 et BSD m4 remplacent juste la definition en haut de la pile,
 > tandis que le m4 de Solaris efface toutes les definitions.

 > Autoconf se repose sur ce comportement. En modifiant le comportement
 > de m4 pour correspondre a solaris, autoconf proteste qu'on lui enleve
 > m4_divert_stack.

 > Corollaire: ne pas melanger define et pushdef/popdef.

 > Si tu veux un define de semantique bien definie:

 > Comportement GNU m4/BSD m4:
 > popdef(a)pushdef(a,defn)

 > Comportement Solaris:
 > undefine(a)pushdef(a,defn)

 > Ca serait pas mal si tu corrigeais m4sugar pour avoir une semantique
 > bien definie.

The bottom line of this message is that GNU and BSD M4 understand
m4_define as modifying the topmost definition of the stack of pushdef,
while Solaris M4 understands it as addressing the whole stack,
smashing it as a single definition.

you suggest to step back into specified behavior (the interaction
between define and pushdef being unspecified in something apparently
named Single Unix).

My answer is no.  I do not care about Single Unix's specification for
M4, and I keep on planning using more GNU M4 features.  GNU M4 is a
requirement for Autoconf, and there is no plan to make it easy to use
other M4s.

Thanks anyway!




reply via email to

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