This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Move cpplib to the toplevel

The ACX_HEADER_STDBOOL macro is wrong and broke the m68k-linux bootstrap. This test doesn't check the size of bool and this results in different sizes of bool in libcpp and (stage2) gcc if gcc is bootstrapped with gcc 2.95.
Please either use AC_HEADER_STDBOOL or take a copy from a recent autoconf.

It seems that even Autoconf's AC_HEADER_STDBOOL cannot help here. They do not test for sizeof (bool) being 1.

Please test the attached definition of ACX_HEADER_STDBOOL.

[AC_CACHE_CHECK([for working stdbool.h],
[AC_TRY_COMPILE([#include <stdbool.h>
#ifndef bool
# error bool is not defined
#ifndef false
# error false is not defined
#if false
# error false is not 0
#ifndef true
# error true is not defined
#if true != 1
# error true is not 1
#ifndef __bool_true_false_are_defined
# error __bool_true_false_are_defined is not defined

struct s { _Bool s: 1; _Bool t; } s;
char a[true == 1 ? 1 : -1];
char b[false == 0 ? 1 : -1];
char c[__bool_true_false_are_defined == 1 ? 1 : -1];
char d[(bool) -0.5 == true ? 1 : -1];
bool e = &s;
char f[(_Bool) -0.0 == false ? 1 : -1];
char g[true];
char h[sizeof (_Bool) == 1 ? 1 : -1];
char i[sizeof s.t];
],[return !a + !b + !c + !d + !e + !f + !g + !h + !i;],
if test $ac_cv_header_stdbool_h = yes; then
  AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.])
AC_CACHE_CHECK(for built-in _Bool, acx_cv_c__bool,
[_Bool foo;],
acx_cv_c__bool=yes, acx_cv_c__bool=no)
if test $acx_cv_c__bool = yes; then
  AC_DEFINE(HAVE__BOOL, 1, [Define if the \`_Bool' type is built-in.])

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]