This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: make, make bootstrap, bool & gcc 2.95
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- To: Fergus Henderson <fjh at cs dot mu dot oz dot au>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Fri, 20 Sep 2002 09:48:06 +0100 (BST)
- Subject: Re: make, make bootstrap, bool & gcc 2.95
On Fri, 20 Sep 2002, Fergus Henderson wrote:
> One way to avoid it this particular problem, at least on x86, would be
> to define `_Bool' as `int' rather than `char' if the bootstrap compiler
> doesn't define it.
The problem would be that though 2.95 doesn't have _Bool it has a broken
and incompatible <stdbool.h>. I suggest removing the HAVE_STDBOOL_H test
in system.h and not using <stdbool.h> at all: system.h defines "bool",
"true" and "false" the same way as any C99 <stdbool.h> will. I.e.
(untested and the configure test for <stdbool.h> should be removed as
well):
--- system.h.orig 2002-08-21 09:09:17.000000000 +0000
+++ system.h 2002-09-20 08:46:29.000000000 +0000
@@ -534,25 +534,20 @@
#define __builtin_expect(a, b) (a)
#endif
-/* Provide some sort of boolean type. We use stdbool.h if it's
- available. This must be after all inclusion of system headers,
- as some of them will mess us up. */
+/* Provide some sort of boolean type. This must be after all inclusion
+ of system headers, as some of them will mess us up. */
#undef bool
#undef true
#undef false
#undef TRUE
#undef FALSE
-#ifdef HAVE_STDBOOL_H
-# include <stdbool.h>
-#else
-# if !HAVE__BOOL
+#if !HAVE__BOOL
typedef char _Bool;
-# endif
-# define bool _Bool
-# define true 1
-# define false 0
#endif
+#define bool _Bool
+#define true 1
+#define false 0
#define TRUE true
#define FALSE false
--
Joseph S. Myers
jsm28@cam.ac.uk