This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Today's K&R problem ... cpphash.c uses `signed'
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: Today's K&R problem ... cpphash.c uses `signed'
- From: Michael Meissner <meissner at cygnus dot com>
- Date: Thu, 13 Jul 2000 18:19:05 -0400
- Cc: zack at wolery dot cumb dot org, gcc-patches at gcc dot gnu dot org
- References: <200007131920.PAA18027@caip.rutgers.edu>
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