This is the mail archive of the gcc-patches@gcc.gnu.org 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.

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

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;],
[acx_cv_header_stdbool_h=yes],
[acx_cv_header_stdbool_h=no])])
if test $ac_cv_header_stdbool_h = yes; then
  AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.])
fi
AC_CACHE_CHECK(for built-in _Bool, acx_cv_c__bool,
[AC_TRY_COMPILE(,
[_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.])
fi])# ACX_HEADER_STDBOOL

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