This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Today's K&R problem ... cpphash.c uses `signed'
- To: zack at wolery dot cumb dot org
- Subject: Today's K&R problem ... cpphash.c uses `signed'
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Thu, 13 Jul 2000 15:20:46 -0400 (EDT)
- Cc: gcc-patches at gcc dot gnu dot org
Here's today's obligatory K&R nit in cpp. :-)
Traditional C doesn't grok the `signed' keyword.
Patch below tested on sparc-sun-sunos4.1.4, okay to install?
--Kaveh
PS: another approach would be to simply take the signed keyword out if
its not necessary to ensure the `paramc' member is in fact signed.
2000-07-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
include:
* ansidecl.h (SIGNED): Don't hide within !IN_GCC.
gcc:
* cpphash.c (macro_info): Use `SIGNED' not `signed'.
diff -rup ../egcs-CVS20000712/include/ansidecl.h egcs-CVS20000712/include/ansidecl.h
--- ../egcs-CVS20000712/include/ansidecl.h Mon May 8 20:10:42 2000
+++ egcs-CVS20000712/include/ansidecl.h Wed Jul 12 22:35:05 2000
@@ -107,8 +107,8 @@ Foundation, Inc., 59 Temple Place - Suit
#define AND ,
#define NOARGS void
#define VOLATILE volatile
-#define SIGNED signed
#endif /* ! IN_GCC */
+#define SIGNED signed
#define PARAMS(paramlist) paramlist
#define ANSI_PROTOTYPES 1
@@ -136,8 +136,8 @@ Foundation, Inc., 59 Temple Place - Suit
#define AND ;
#define NOARGS
#define VOLATILE
-#define SIGNED
#endif /* !IN_GCC */
+#define SIGNED
#ifndef const /* some systems define it in header files for non-ansi mode */
#define const
diff -rup ../egcs-CVS20000712/gcc/cpphash.c egcs-CVS20000712/gcc/cpphash.c
--- ../egcs-CVS20000712/gcc/cpphash.c Wed Jul 12 16:18:26 2000
+++ egcs-CVS20000712/gcc/cpphash.c Wed Jul 12 22:25:31 2000
@@ -45,7 +45,7 @@ struct hashdummy
struct macro_info
{
unsigned int paramlen;
- signed short paramc;
+ SIGNED short paramc;
unsigned char flags;
};