[Top][All Lists]

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

Re: #if vs. #ifdef -- again (was: AC_CHECK_SIZEOF failing on undefined H

From: nash
Subject: Re: #if vs. #ifdef -- again (was: AC_CHECK_SIZEOF failing on undefined HAVE_STDINT_H with -Werror)
Date: Tue, 15 Aug 2006 10:25:42 -0400

Wouldn't it be preferrable to use #if so that a config.h token could
be an expression that variously evaluates to T/F depending on other
stuff? For example,

In config.h somewhere:
 #define HAVE_WORKING_MMAP (defined(HAVE_MMAP) && defined(HAVE_MUNMAP))

In the program:
 ... stuff ...
 ... different stuff  ...

Stupid example but the point is that using #ifdef wouldn't work for
this. Seems like a program checking a config.h identifier shouldn't
really have to know whether it evaluates to an expression, or not.


On 8/15/06, Stepan Kasal <address@hidden> wrote:

On Tue, Aug 15, 2006 at 03:45:13PM +0200, Ralf Wildenhues wrote:
> Neither can I, but there has been a move in some GNU packages (Autoconf,
> Gnulib) from #ifdef to #if, which I've never understood.  If we want a
> move back, we need to know the incentives that caused it in the first
> place, and see whether the reasons for it are (still) valid, to avoid
> bouncing back and forth.

that's why asked here.  Let's wait for an answer from Paul.

> I believe the feedback loop on some of the more obscure issues w.r.t.
> Autoconf can easily execed a couple of years.  Not sure if this is one
> of them.

Well, the move from #ifdef to #if happened sometimes around 2000.

Autoconf 2.50 already used #if in all code (w/ 1 exception).
Autoconf 2.13 used #ifdef in the code almost exclusively (w/ one
exception), but the manual used #if.


Autoconf mailing list

reply via email to

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