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]

Today's K&R problem ... cpphash.c uses `signed'


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;
 };
 

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