Hi,

I don't know if this mail got through without losing a few electrons
due to the recent mailinglist hickups, so I'm resending it. With a
patch this time, so it might be easier to get it applied.  :^}

2000-10-02 Morten Eriksen <[EMAIL PROTECTED]>

        * aclang.m4 (AC_LANG_SOURCE(C++)): don't define exit(), it'll
        mismatch with the native exit() definition on some platforms
        (happens at least with g++ 2.96 and glibc 2.1.92 on Red Hat Linux
        v7).


Regards,
Morten

Index: ChangeLog
===================================================================
RCS file: /cvs/autoconf/ChangeLog,v
retrieving revision 1.895
diff -u -r1.895 ChangeLog
--- ChangeLog   2000/10/02 13:11:27     1.895
+++ ChangeLog   2000/10/02 17:24:17
@@ -1,3 +1,10 @@
+2000-10-02 Morten Eriksen <[EMAIL PROTECTED]>
+
+       * aclang.m4 (AC_LANG_SOURCE(C++)): don't define exit(), it'll
+       mismatch with the native exit() definition on some platforms
+       (happens at least with g++ 2.96 and glibc 2.1.92 on Red Hat Linux
+       v7).
+
 2000-10-02  Akim Demaille  <[EMAIL PROTECTED]>
 
        * aclang.m4 (_AC_LANG_ABBREV, _AC_LANG_ABBREV(C))
Index: aclang.m4
===================================================================
RCS file: /cvs/autoconf/aclang.m4,v
retrieving revision 1.68
diff -u -r1.68 aclang.m4
--- aclang.m4   2000/10/02 13:11:28     1.68
+++ aclang.m4   2000/10/02 17:19:28
@@ -412,9 +412,6 @@
 define([AC_LANG_SOURCE(C++)],
 [#line __oline__ "configure"
 #include "confdefs.h"
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
 $1])
 
 





Hi,

I just discovered a nasty problem with the latest CVS Autoconf on Red
Hat Linux v7 (default setup, i.e. with g++ 2.96). In short, the
AC_TRY_COMPILE in the configure.in script below will fail:

->8-->8--->8-->8--->8-->8--->8-->8--->8-->8--->8-->8--->8-->8--

AC_INIT(configure.in)
AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([#include <stdlib.h>], [], , AC_MSG_ERROR(sorr-ee))
AC_OUTPUT()

->8-->8--->8-->8--->8-->8--->8-->8--->8-->8--->8-->8--->8-->8--

Here's the relevant part of config.log:

->8-->8--->8-->8--->8-->8--->8-->8--->8-->8--->8-->8--->8-->8--

[...]
configure:1141: g++ -c -g -O2  conftest.cpp >&5
In file included from configure:1135:
/usr/include/stdlib.h:578: declaration of `void exit (int) throw ()' 
throws different exceptions
configure:1132: than previous declaration `void exit (int)'
configure: failed program was:
#line 1130 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit (int);
#endif
#include <stdlib.h>
int
main ()
{

  ;
  return 0;
}

->8-->8--->8-->8--->8-->8--->8-->8--->8-->8--->8-->8--->8-->8--

Now, this is obviously due to the "extern" forward declaration of
exit() not matching the exit() defined by the stdlib.h of GCC 2.96
when run as a C++ compiler.

Why is the explicit exit() declaration there anyway? Removing it will
of course make the configure script run correctly.

Regards,
Morten



Reply via email to