autoconf-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] Serious problem with Autoconf on RedHat 7


From: Alexandre Oliva
Subject: Re: [PATCH] Serious problem with Autoconf on RedHat 7
Date: 03 Oct 2000 10:34:27 -0200
User-agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)

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.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  address@hidden, redhat.com}
CS PhD student at IC-Unicamp        address@hidden, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me



reply via email to

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