[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problem with exit() and new version of gcc.
From: |
Mo DeJong |
Subject: |
Problem with exit() and new version of gcc. |
Date: |
Sun, 17 Dec 2000 03:12:22 -0800 (PST) |
Hello.
I have run into an interesting little problem with
a newer version of gcc and the CVS version of autoconf.
I am using an autoconf test that attempts to see if
the new style C++ sytle includes can be used:
like so:
AC_DEFUN(AC_CXX_HAVE_STD,
[AC_CACHE_CHECK(whether the compiler supports ISO C++ standard library,
ac_cv_cxx_have_std,
[AC_REQUIRE([AC_CXX_NAMESPACES])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <iostream>
#include <map>
#include <iomanip>
#include <cmath>
#ifdef HAVE_NAMESPACES
using namespace std;
#endif],[return 0;],
ac_cv_cxx_have_std=yes, ac_cv_cxx_have_std=no)
AC_LANG_RESTORE
])
if test "$ac_cv_cxx_have_std" = yes; then
AC_DEFINE(HAVE_STD,,[define if the compiler supports ISO C++ standard
library])
fi
])
That gets written out to conftest.cc as:
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit (int);
#endif
#include <iostream>
#include <map>
#include <iomanip>
#include <cmath>
#ifdef HAVE_NAMESPACES
using namespace std;
#endif
int
main ()
{
return 0;
;
return 0;
}
When g++ tries to compile it, it fails like so:
% g++ -c -g conftest.cc
In file included from
/abomination/imagine/mdejong/java/install/include/g++-v3/bits
/std_cstdlib.h:40,
from
/abomination/imagine/mdejong/java/install/include/g++-v3/bits
/stl_alloc.h:53,
from
/abomination/imagine/mdejong/java/install/include/g++-v3/bits
/stl_string_fwd.h:18,
from
/abomination/imagine/mdejong/java/install/include/g++-v3/bits
/std_ios.h:40,
from
/abomination/imagine/mdejong/java/install/include/g++-v3/bits
/std_ostream.h:1,
from
/abomination/imagine/mdejong/java/install/include/g++-v3/bits
/std_iostream.h:38,
from
/abomination/imagine/mdejong/java/install/include/g++-v3/iost
ream:1,
from configure:2148:
/usr/include/stdlib.h:520: declaration of `void exit(int) throw ()'
throws
different exceptions
configure:2148: than previous declaration `void exit(int)'
Later tests will fail because of this, so the result
is that my package will not compile with the CVS
version of gcc. If I add a "throw ()" to the
end of that exit declaration, it compiles. Is this
a bug in the compiler or a problem in autoconf?
Mo DeJong
Red Hat Inc
- Problem with exit() and new version of gcc.,
Mo DeJong <=