[Top][All Lists]

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

Re: Warnings for excessive macro arguments

From: Eric Blake
Subject: Re: Warnings for excessive macro arguments
Date: Mon, 23 Aug 2010 11:50:22 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100806 Fedora/3.1.2-1.fc13 Mnenhy/0.8.3 Thunderbird/3.1.2

On 08/23/2010 11:02 AM, Yavor Doganov wrote:
I was wondering if it is possible (and whether it is a good idea in
general) autoconf to print warnings for extra macro arguments instead
of silently ignoring them.

I have to wonder if there are cases where rejecting extra arguments might not be advisable, because it hampers future extensions that assign meaning to those extra arguments while still being backwards compatible with earlier versions. That is, if 2.67 supports macro ABC(arg), then in 2.68 we add support for ABC(arg1, arg2), there is the question of whether the person calling ABC(arg1, arg2) will get sane semantics even if they use 2.67, by silently ignoring arg2.

On the other hand, any good extension is one where leaving the argument blank achieves the same behavior as the old version. And since the older version knows that it doesn't handle extra arguments, checking for a maximum $# (or, perhaps more robustly, checking that any arguments after a maximum $# are blank) may be feasible. But it would take a lot of work to add that to all the existing autoconf macros.


The generated configure script fails on OpenBSD and Woe32, because
<pthread.h>  is not #include'd in the test program.

It took me some time to spot where the problem is :-)

At any rate, this is an interesting feature request. Maybe the thing to do now is add mention of it in TODO, if we don't come up with a patch right away?

Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

reply via email to

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