[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH] Serious problem with Autoconf on RedHat 7
From: |
Bernard Dautrevaux |
Subject: |
RE: [PATCH] Serious problem with Autoconf on RedHat 7 |
Date: |
Tue, 3 Oct 2000 15:34:35 +0200 |
> -----Original Message-----
> From: Alexandre Oliva [mailto:address@hidden
> Sent: Tuesday, October 03, 2000 2:34 PM
> To: Morten Eriksen
> Cc: address@hidden; address@hidden
> Subject: Re: [PATCH] Serious problem with Autoconf on RedHat 7
>
>
> On Oct 2, 2000, Morten Eriksen <address@hidden> wrote:
>
> > * 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).
>
> The problem is that, if we don't define it, we risk getting the tests
> rejected due to the lack of a declaration of exit(). IIRC, the
> declaration was put in because some C++ compiler wouldn't declare
> exit(int) in stdlib.h and would reject translation units that called
> exit() without declaring it. Even though your particular example
> doesn't call exit(int), some other tests do, and they don't take the
> trouble of declaring exit(int) themselves.
>
> I'm not sure what is the best way to go here. Another potential
> source of trouble is if a compiler only declares exit(int) in
> namespace std.
>
> Maybe AC_PROG_CXX should automatically check whether a translation
> unit that #includes <stdlib.h> and calls exit() fails to compile, and
> attempt to declare exit() otherwise. Our Standard C++ template would
> become:
>
> #include "confdefs.h"
> #if CXX_NEEDS_EXIT_DECL
> extern "C" void exit (int);
> #endif
> #include <stdlib.h>
>
> The first program we'd attempt to compile would determine wehther
> CXX_NEEDS_EXIT_DECL, and #define it in confdefs.h, so that further
> compilations would be able to tell whether to declare it or not.
>
Anyway, this test should be a standard C++ test, defining
CXX_NEEDS_EXIT_DECL in config.h, so that I can test it in my own programs;
for now I've always assumed "exit()" to be available after #including
<stdlib.h> and if you're right I w'll get in trouble some day :-)
Regards,
Bernard
--------------------------------------------
Bernard Dautrevaux
Microprocess Ingenierie
97 bis, rue de Colombes
92400 COURBEVOIE
FRANCE
Tel: +33 (0) 1 47 68 80 80
Fax: +33 (0) 1 47 88 97 85
e-mail: address@hidden
address@hidden
--------------------------------------------