[Top][All Lists]

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

Re: Can a pushdef pop itself dependably?

From: Eric Blake
Subject: Re: Can a pushdef pop itself dependably?
Date: Tue, 28 Oct 2008 05:50:52 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20080914 Thunderbird/ Mnenhy/

Hash: SHA1

According to Jack Woehr on 10/28/2008 3:21 AM:
> Can I depend on this sort of behavior ... that a pushdef can pop itself
> in the middle
> and the revealed definition execute and the popped def finishes off
> before vanishing?

Yes, but only if you depend on m4 1.4.5 or newer (more precisely, beta
1.4.4b, when I first took over m4 maintenance - one of the first patches I
applied was a reference counting mechanism to avoid coredumps and other
memory corruption that were previously present when you attempted this).

The manual documents this behavior, and it is tested as part of the
testsuite, so this behavior is guaranteed to not revert.  This very bug of
earlier m4 not reliably handling self-modifying macros is one of the
reasons that autoconf 2.63 requires M4 1.4.5 or greater (check out
m4/m4.m4 in the autoconf sources for a simple test to weed out broken m4).

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


reply via email to

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