🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.ghostscript.bug
Article #80

cc error at gdevmem1.c: 456

#80
From: L. Peter Deutsch
Date: Thu, 09 Apr 1992 06:07
25 lines
1589 bytes
In <9204090030.AA03121@raisin-nut>
<9204081906.AA15019@gateway.bnr.ca>, Richard (R.) Johns writes,
regarding Ghostscript 2.4:

> Here's another problem, not related to HP cc optimization:
> 
> > make
>         ./ccgs "cc  -O  -DSYSV -Wc,-Ns5000 -Wc,-Nw500" _temp_.c gdevmem1.c
> "gdevmem1.c", line 456: operands of + have incompatible types
> 
> It certainly doesn't look like there're any problems that wouldn't show up
> with any cc compiler.  Any suggestions?

In my opinion, this is a C compiler bug.  The statement in question
adds two values of different enum types, but the ANSI standard
specifically says that names in enum types are "declared as constants
of type int", so the compiler must allow them to be used freely as
though they were ints.  I know of no other C compiler that forbids
this, although some compilers have similar, less serious problems of
this kind (e.g., not allowing a enum value to be used as the index in
a switch statement).

L. Peter Deutsch :: Aladdin Enterprises :: P.O. box 60264, Palo Alto, CA 94306
ghost@aladdin.com, ...decwrl!aladdin!ghost ; 415-322-0103 8-9 AM M-F/msg
	    "Implementation is the sincerest form of flattery."
Technical Details
Message-ID: <9204082307.1.UUL1.3#5127@aladdin.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!aladdin.COM!ghost

Show Full Headers
Complete Article Headers
Newsgroups: gnu.ghostscript.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!aladdin.COM!ghost
From: ghost@aladdin.COM (L. Peter Deutsch)
Subject: cc error at gdevmem1.c: 456
Message-ID: <9204082307.1.UUL1.3#5127@aladdin.com>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Thu, 9 Apr 1992 06:07:35 GMT
Approved: bug-ghostscript@prep.ai.mit.edu
Lines: 27