This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
fix bootstrap comparison failures
- From: Richard Henderson <rth at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 18 Sep 2002 14:38:50 -0700
- Subject: fix bootstrap comparison failures
Well, some of them anyway.
When starting from gcc 2.96 (or some other non-recent or non-gcc), we
don't have a C99 compliant boolean. What we've got is regular integral
type typedefed to bool. Which means that any time we rely on the
properties of a C99 boolean, we're wrong.
Alex Oliva suggested enhancing -Wtraditional to catch this kind of thing.
I'm inclined to agree, since this sort of error will become more common
over time. I have no intention of actually implementing this at the
moment though.
r~
* real.c (sticky_rshift_significand): Collect sticky as
unsigned long, not bool.
Index: real.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/real.c,v
retrieving revision 1.75.4.2
diff -c -p -d -u -r1.75.4.2 real.c
--- real.c 17 Sep 2002 22:58:45 -0000 1.75.4.2
+++ real.c 18 Sep 2002 20:50:04 -0000
@@ -239,7 +239,7 @@ sticky_rshift_significand (r, a, n)
const struct real_value *a;
unsigned int n;
{
- bool sticky = false;
+ unsigned long sticky = 0;
unsigned int i, ofs = 0;
if (n >= HOST_BITS_PER_LONG)
@@ -268,7 +268,7 @@ sticky_rshift_significand (r, a, n)
r->sig[i] = 0;
}
- r->sig[0] |= sticky;
+ r->sig[0] |= (sticky != 0);
}
/* Right-shift the significand of A by N bits; put the result in the