This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch installed to fix two bootstrap failures
- To: law at cygnus dot com
- Subject: Patch installed to fix two bootstrap failures
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Sat, 6 Feb 1999 10:42:58 -0500 (EST)
- Cc: egcs-patches at cygnus dot com
I had some trouble bootstrapping using OSF4 cc:
> cc -c -DIN_GCC -DHAIFA -g -DHAVE_CONFIG_H -I. -I. -I./config
> -I./../include cppfiles.c
> cc: Warning: cppfiles.c, line 863: In this statement, the referenced
> type of the pointer value "xrealloc(...)" is "signed char", which is
> not compatible with "unsigned char".
> buf = xrealloc (buf, len);
> ----------^
> cc: Warning: cppfiles.c, line 992: In this statement, the referenced
> type of the pointer value "xrealloc(...)" is "signed char", which is
> not compatible with "unsigned char".
> buf = xrealloc (buf, len);
> ----------^
> cc: Error: cppfiles.c, line 1000: In this statement, "buf" and
> "xrealloc(...)" may not be combined in a conditional expression.
> fp->buf = (len - offset < 20) ? buf : xrealloc (buf, op - buf);
> ------------^
> make[2]: *** [cppfiles.o] Error 1
So I installed the following patch which fixes the two
warnings and the one error. I also fixed a problem in cppinit.c for
SunOS4 cc.
--Kaveh
Index: ChangeLog
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/ChangeLog,v
retrieving revision 1.2919
diff -u -p -r1.2919 ChangeLog
--- ChangeLog 1999/02/06 04:09:49 1.2919
+++ ChangeLog 1999/02/06 15:20:29
@@ -1,3 +1,11 @@
+Sat Feb 6 10:18:01 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * cppfiles.c (read_and_prescan): Cast the result of `xrealloc' to
+ U_CHAR* when assigning to one. Ensure the values of a ?: operator
+ have the same type.
+
+ * cppinit.c (initialize_char_syntax): Use K&R function definition.
+
Sat Feb 6 11:17:03 1999 Richard Earnshaw <rearnsha@arm.com>
Support for ARM9
Index: cppfiles.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cppfiles.c,v
retrieving revision 1.12
diff -u -p -r1.12 cppfiles.c
--- cppfiles.c 1999/02/04 11:36:52 1.12
+++ cppfiles.c 1999/02/06 15:20:31
@@ -860,7 +860,7 @@ read_and_prescan (pfile, fp, desc, len)
delta_op = op - buf;
delta_line_base = line_base - buf;
- buf = xrealloc (buf, len);
+ buf = (U_CHAR *) xrealloc (buf, len);
op = buf + delta_op;
line_base = buf + delta_line_base;
}
@@ -989,7 +989,7 @@ read_and_prescan (pfile, fp, desc, len)
len += 2;
if (offset + 2 > len)
goto too_big;
- buf = xrealloc (buf, len);
+ buf = (U_CHAR *) xrealloc (buf, len);
op = buf + offset;
}
if (op[-1] == '\\')
@@ -997,7 +997,8 @@ read_and_prescan (pfile, fp, desc, len)
*op++ = '\n';
}
- fp->buf = (len - offset < 20) ? buf : xrealloc (buf, op - buf);
+ fp->buf =
+ (U_CHAR *) ((len - offset < 20) ? (PTR) buf : xrealloc (buf, op - buf));
return op - buf;
too_big:
Index: cppinit.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cppinit.c,v
retrieving revision 1.1
diff -u -p -r1.1 cppinit.c
--- cppinit.c 1999/02/04 11:36:52 1.1
+++ cppinit.c 1999/02/06 15:20:31
@@ -51,7 +51,8 @@ U_CHAR trigraph_table[256] = { 0 };
/* Initialize syntactic classifications of characters. */
void
-initialize_char_syntax (int dollar_in_ident)
+initialize_char_syntax (dollar_in_ident)
+ int dollar_in_ident;
{
is_idstart['a'] = 1; is_idstart['b'] = 1; is_idstart['c'] = 1;
is_idstart['d'] = 1; is_idstart['e'] = 1; is_idstart['f'] = 1;