[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Possible bug in many acspecific tests under AC_LANG(C++)
From: |
Nix |
Subject: |
Possible bug in many acspecific tests under AC_LANG(C++) |
Date: |
28 May 2002 23:40:10 +0100 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Economic Science) |
[Please Cc me: I'm not subscribed.]
I've noticed something disturbing about AC_LANG(C++) in conjunction with
conforming C++ compilers (such as GCC-3.x): it's probably been present
since autoconf-2.50, but I tested it with autoconf-2.53 and GCC-3.1.
Here's a microscopic test case that demonstrates the problem:
AC_INIT
AC_LANG(C++)
AC_FUNC_MEMCMP
Alas, AC_FUNC_{everything} assumes (because it has to) that prototypes
are not mandatory: but alas, in C++ they are:
configure:1704: g++ -o conftest -g -O2 conftest.cc >&5
configure: In function `int main()':
configure:1675: `memcmp' undeclared (first use this function)
configure:1675: (Each undeclared identifier is reported only once for each
function it appears in.)
configure:1689: `strcpy' undeclared (first use this function)
configure:1707: $? = 1
oops.
I'd guess the right thing to do about this is to make the function
checks sort of work in the presence of prototype-strict C++: for things
documented in the C++ Standard (such as strcmp()) this is tolerable, but
for things that are in POSIX but not in C++, it might be hard to work
out what the right header is to use as a prerequisite.
(We'd want the checks to work in the old way for C, of course.)
I'd say that autoconf needs to support AC_FUNC checks *somehow* in the
presence of AC_LANG(C++), because otherwise we're assuming that the C
and C++ compilers can see a similar set of functions, which seems to me
to be quite unwarranted.
Thoughts? Am I barking up a gum tree?
--
`What happened?'
`Nick shipped buggy code!'
`Oh, no dinner for him...'
<
- Possible bug in many acspecific tests under AC_LANG(C++),
Nix <=