This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: allow `signed' in a function style cast
- To: egcs-patches at egcs dot cygnus dot com
- Subject: PATCH: allow `signed' in a function style cast
- From: Nathan Sidwell <nathan at acm dot org>
- Date: Thu, 25 Mar 1999 11:37:37 +0000
- Organization: University of Bristol
- Reply-To: nathan at compsci dot bristol dot ac dot uk
Hi,
this is a patch for http://egcs.cygnus.com/ml/egcs-bugs/1999-03/msg00687.html
where the compiler was rejecting a function cast such as `signed(5)'
The problem was init_decl_processing (decl.c) did not add integer_type_node
under the name `signed'.
No additional regressions in the testsuite occur with this patch (on
sparc-sun-solaris-2.6).
I also attach a test case
Enjoy,
nathan
--
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
You can up the bandwidth, but you can't up the speed of light
nathan@acm.org http://www.cs.bris.ac.uk/~nathan/ nathan@cs.bris.ac.uk
egscs/gcc/cp/ChangeLog:
Wed Mar 24 21:05:54 GMT 1999 Nathan Sidwell <nathan@acm.org>
* decl.c (init_decl_processing): Add `signed' type as a synonym
for `int'.
*** decl.c Wed Mar 24 21:05:00 1999
--- decl.c.new Wed Mar 24 21:04:52 1999
*************** init_decl_processing ()
*** 5955,5960 ****
--- 5955,5963 ----
: make_unsigned_type (CHAR_TYPE_SIZE));
record_builtin_type (RID_CHAR, "char", char_type_node);
+ /* `signed' is the same as `int' */
+ record_builtin_type (RID_SIGNED, NULL_PTR, integer_type_node);
+
long_integer_type_node = make_signed_type (LONG_TYPE_SIZE);
record_builtin_type (RID_LONG, "long int", long_integer_type_node);
// Build don't link:
// Copyright (C) 1999 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 24 Mar 1999 <nathan@acm.org>
// Determine that function style casts are groked
void fn()
{
+char(5);
+short(5);
+int(5);
+long(5);
+signed(5);
+unsigned(5);
}