bug-autoconf
[Top][All Lists]
Advanced

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

Re: divert()/m4_divert() broken in autoconf-2.64+


From: Mike Frysinger
Subject: Re: divert()/m4_divert() broken in autoconf-2.64+
Date: Sat, 21 Nov 2009 17:47:09 -0500
User-agent: KMail/1.12.3 (Linux/2.6.31.4; KDE/4.3.3; x86_64; ; )

On Saturday 21 November 2009 15:06:01 Eric Blake wrote:
> According to Mike Frysinger on 11/21/2009 12:14 PM:
> > i'm not really familiar with the diversion functionality of m4, so i'll
> > just post findings ...
> >
> > this simple code works under <=autoconf-2.63:
> > $ cat configure.ac
> > AC_INIT(f, 0)
> 
> Get in the habit of using AC_INIT([f], [0]).

the point in examples is to minimize extraneous noise, not worry about useless 
quoting

> > m4_divert(1)
> 
> There's the bug - in the user's script and not in autoconf.  Diversion 1
> is too low, and gets output PRIOR to initialization text that autoconf
> assumes will be present.  By using a raw number, instead of a named
> diversion, the user has violated constraints.  According to the manual,
> you should rely on named diversions rather than mucking with raw diversion
> numbers.  Fix the bug in the user's configure.ac by instead using a named
> diversion reserved for application initialization:
> m4_divert([INIT_PREPARE]).  If the user still insists on a raw number, at
> least use something in the range of 300-1000, since autoconf assumes that
> all diversions prior to 300 (aka INIT_PREPARE) are reserved for autoconf's
> initialization; the user's output normally starts at 1000 (aka BODY).

the autoconf documentation here is a far cry from anything you can point at 
and say "this is a bug in your code".  all it says:
        it is nicer to associate a name with each diversion; the diversion 
number
        associated with a particular diversion name is an implementation 
detail, so
        you should only use diversion names

which is not the same as "you must never use numbers less than 300 or your 
script will break".  especially because things have worked just fine without 
any warnings, and even now there are no warnings.  just ugly shell errors (and 
in some larger scripts, infinite loops of them).

if there are reserved numerical regions, then autoconf really needs to 
warn/error out here.
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

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