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]

non-ANSI bootstrap nits


Hi,
  This fixes a couple of nits where functions are called with (possibly)
different sized args than expected.  Only a problem with non-ANSI
prototype capable compilers that happen to have `HOST_WIDEST_INT' a
different size to `int'.  Noticed when trying (unsuccessfully so far) to
bootstrap with the HPUX bundled cc.

	* cppexp.c (parse_charconst):  Change `mask' type to agree
	with parse_escape.
	* tree.c (build_index_type): Cast return of tree_low_cst to
	agree with type_hash_canon param.
	(build_range_type): Likewise.

Alan Modra
-- 
Linuxcare.  Support for the Revolution.

diff -urp -xCVS -xTAGS -x*~ egcs/gcc/cppexp.c newegcs/gcc/cppexp.c
--- egcs/gcc/cppexp.c	Fri Dec  8 19:54:44 2000
+++ newegcs/gcc/cppexp.c	Mon Jan 22 11:57:53 2001
@@ -1,5 +1,5 @@
 /* Parse C expressions for cpplib.
-   Copyright (C) 1987, 1992, 1994, 1995, 1997, 1998, 1999, 2000
+   Copyright (C) 1987, 1992, 1994, 1995, 1997, 1998, 1999, 2000, 2001
    Free Software Foundation.
    Contributed by Per Bothner, 1994.
 
@@ -248,7 +248,8 @@ parse_charconst (pfile, tok)
   HOST_WIDEST_INT result = 0;
   int num_chars = 0;
   int num_bits;
-  unsigned int width = MAX_CHAR_TYPE_SIZE, mask = MAX_CHAR_TYPE_MASK;
+  unsigned int width = MAX_CHAR_TYPE_SIZE;
+  HOST_WIDEST_INT mask = MAX_CHAR_TYPE_MASK;
   int max_chars;
   const U_CHAR *ptr = tok->val.str.text;
   const U_CHAR *end = ptr + tok->val.str.len;
diff -urp -xCVS -xTAGS -x*~ egcs/gcc/tree.c newegcs/gcc/tree.c
--- egcs/gcc/tree.c	Mon Jan  8 22:47:00 2001
+++ newegcs/gcc/tree.c	Mon Jan 22 11:57:49 2001
@@ -1,6 +1,6 @@
 /* Language-independent node constructors for parse phase of GNU compiler.
    Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000 Free Software Foundation, Inc.
+   1999, 2000, 2001 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -3724,7 +3724,7 @@ build_index_type (maxval)
   TYPE_USER_ALIGN (itype) = TYPE_USER_ALIGN (sizetype);
 
   if (host_integerp (maxval, 1))
-    return type_hash_canon (tree_low_cst (maxval, 1), itype);
+    return type_hash_canon ((unsigned int) tree_low_cst (maxval, 1), itype);
   else
     return itype;
 }
@@ -3755,8 +3755,8 @@ build_range_type (type, lowval, highval)
   TYPE_USER_ALIGN (itype) = TYPE_USER_ALIGN (type);
 
   if (host_integerp (lowval, 0) && highval != 0 && host_integerp (highval, 0))
-    return type_hash_canon (tree_low_cst (highval, 0)
-			    - tree_low_cst (lowval, 0),
+    return type_hash_canon ((unsigned int) (tree_low_cst (highval, 0)
+					    - tree_low_cst (lowval, 0)),
 			    itype);
   else
     return itype;


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