[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 91-c++-exit-decl.patch
From: |
Pavel Roskin |
Subject: |
Re: 91-c++-exit-decl.patch |
Date: |
Sun, 24 Dec 2000 03:39:47 -0500 (EST) |
Hello, Akim!
> I'm not sure I will be able to apply this patch. If it is approved,
> don't hesitate to apply it, or to fix and apply it.
At least some parts need to be applied.
> * aclang.m4 (_AC_PROG_CXX_EXIT_DECLARATION): New.
> (AC_PROG_CC, AC_PROG_CXX): Use it.
> (AC_PROG_CC_STDC): Be sure to remove tmp files.
> * tests/compile.at (AC_TRY_LINK_FUNC): Don't use exit to test it,
> since it produces a prototype which conflicts with the one
> computed by _AC_PROG_CXX_EXIT_DECLARATION.
> * tests/semantics.at (AC_CHECK_FUNCS, AC_HAVE_FUNCS): Likewise.
> (AC_HAVE_FUNCS): Test AC_HAVE_FUNCS!
Sounds good.
> +** AC_CHECK_FUNCS and AC_TRY_LINK_FUNC
> +I have still not understood what's the difference between the two
> +which requires to have two different sources: AC_LANG_CALL and
> +AC_LANG_FUNC_LINK_TRY (which names seem to be inappropriate).
> +Wouldn't one be enough?
The difference may be purely historical.
> -[AC_LANG_PROGRAM([m4_default([$1], address@hidden:@include "stdio.h"])],
> +[AC_LANG_PROGRAM([m4_default([$1], address@hidden:@include <stdio.h>])],
It's a separate issue and needs to be fixed regardless of the rest of the
patch.
> -m4_define([AC_LANG_SOURCE(C++)],
> -[#line __oline__ "configure"
> -#include "confdefs.h"
> -#ifdef __cplusplus
> -extern "C" void exit (int);
> -#endif
> -$1])
> +m4_copy([AC_LANG_SOURCE(C)], [AC_LANG_SOURCE(C++)])
I'm affraid that this change, once applied, will very soon need to be
reverted. C and C++ are different enough to require different
AC_LANG_SOURCE. I understand that we are not going to support C++
compilers that don't define __cplusplus.
> +# Some people use a C++ compiler to compile C. Since we use `exit',
> +# in C++ we need to quote it. In case someone uses the same compiler
> +# for both compiling C and C++ we need to have the C++ compiler decide
> +# the declaration of exit, since it's the most requiring environment.
> +_AC_COMPILE_IFELSE(address@hidden:@ifndef __cplusplus
> + choke me
> address@hidden:@endif],
> + [_AC_PROG_CXX_EXIT_DECLARATION])
That's not good. Every "configure" for pure C projects will contain C++
tests. Support C++ compilers in the C mode is a nice thing to have, but I
doubt that it's really worth it when it comes to such workarounds.
Everything else is Ok.
Regards,
Pavel Roskin