[Top][All Lists]

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

Re: Contents of <confdefs.h> for C++

From: Raja R Harinath
Subject: Re: Contents of <confdefs.h> for C++
Date: Fri, 05 Jul 2002 15:31:41 -0500
User-agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.3.50 (i686-pc-linux-gnu)


Paul Eggert <address@hidden> writes:

>> Date: Fri, 05 Jul 2002 10:40:17 -0500
>> From: "Walter E. Brown" <address@hidden>
>> Thanks, Paul, for the courteous and quick response.
>> Suppose my program defines entities whose names clash with names
>> declared in <stdlib.h>.
> That's certainly reasonable, but we're not talking about your actual
> program here.  We're talking about what the little test program -- the
> one that "configure" compiles.  Surely this little test program can be
> written so that it will still work as desired even if <stdlib.h> is
> included.

Yep.  The program itself will/should never see 'confdefs.h', which
should be deleted once 'configure' is done.  

Also, any fragment in '' is basically testing for
portability (and/or lack of portability :-) -- so it must be quite
tolerant (or quite intolerant so that problems are found quickly).

>> However, there may be compelling reasons for autoconf's current
>> behavior
> If you find them out, please let me know.  Like I said, I don't use
> C++, so I'm not the right guy to ask.  It would be helpful if this
> stuff were written down as comments in the source.


  for ac_declaration in \
   '#include <stdlib.h>' \
   'extern "C" void std::exit (int) throw (); using std::exit;' \
   'extern "C" void std::exit (int); using std::exit;' \
   'extern "C" void exit (int) throw ();' \
   'extern "C" void exit (int);' \
   'void exit (int);'

could use one more alternative:

   '#include <cstdlib>
   using std::exit;'

before the '#include <stdlib.h>' line.

This whole section is necessary since AC_LANG_PROGRAM supports the
use of exit() in C/C++ program test fragments.

- Hari
Raja R Harinath ------------------------------ address@hidden

reply via email to

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