[Top][All Lists]

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

Re: conftest.c should #include confdefs.h

From: Ralf Wildenhues
Subject: Re: conftest.c should #include confdefs.h
Date: Wed, 7 Sep 2005 16:32:09 +0200
User-agent: Mutt/1.4.1i

Hi Stepan,

* Stepan Kasal wrote on Wed, Sep 07, 2005 at 03:34:04PM CEST:
> currently, conftest.c contains a copy of confdefs.h.
> This feature was introduced by Akim in 2002, see
> The reasoning mentions "better logs", not problems with #include.
> But the comment above the definition of AC_LANG_SOURCE(C) at that time
> mentioned that
>       # This sometimes fails to find confdefs.h, for some reason.
> (By mistake, the comment is still there.)
> But as I said, this was not the reason for avoiding #include.

For reference, I'll augment this with some history digging:
This line was seemingly first introduced in Autoconf in acgeneral.m4:
AC_TRY_LINK in revision 1.98 on 1994-08-25.  The cvs commit entry is
| rework diversions and substitutions

and the patch hunk that introduces it is:

| @@ -1150,6 +1140,8 @@
|  [dnl We use return because because C++ requires a prototype for exit.
|  cat > conftest.${ac_ext} <<EOF
| +dnl This sometimes fails to find confdefs.h, for some reason.
| +dnl [#]line __LINE__ "[$]0"
|  #line __LINE__ "configure"
|  #include "confdefs.h"
|  [$1]

This makes it seem that the dnl'ed line is the cause for the failure.
And indeed, there is more evidence supporting this assumption: later
on, in lib/autoconf/c.m4 in revision 1.175 on 2003-03-16, this patch is added:

for the __LINE__ related bug.  It removes the commented-out, "buggy"
line but not the comment that went along with it.

> So I suggest the following optimization.
> OK to commit?

Not my decision.  :)


reply via email to

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