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]

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


On Thu, Jul 13, 2000 at 03:20:46PM -0400, Kaveh R. Ghazi wrote:
> 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.

The only time you need the "signed" keyword is for declaring either signed
chars or signed bitfields (plain chars and bitfields were implementation
defined to be either sign preserving or unsigned even in K&R).  It was one of
three keywords added by the ANSI/ISO process (signed, volatile, void), though
void was actually in use by a number of compilers when the standardization
process began.  Note, "entry" was a reserved keyword in K&R compilers that was
dropped in ANSI/ISO C.

My opinion is to drop "signed" altogether in the code, and don't write code
that depends on signed chars or bitfields.

-- 
Michael Meissner, Red Hat, Inc.
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work:	  meissner@redhat.com		phone: +1 978-486-9304
Non-work: meissner@spectacle-pond.org	fax:   +1 978-692-4482

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