🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #1607

GCC preprocessor bug ?

#1607
From: Todd Clayton
Date: Fri, 08 Jan 1993 02:10
38 lines
1258 bytes
I'm not sure this is a bug, but Sun cc behaves differently than gcc on this
simple testcase. I thought it would be best to report it and let the
pros figure it out. In the simple testcase below I thought "-x" should 
should be treated as separte preprocessing tokens in the macro "Blk".
That is "-" and "x" are seperate tokens and should not be merged as
gcc does.

-Todd

oconee:tmp% gcc -v
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-sunos5.1/2.3.3/specs
gcc version 2.3.3
oconee:tmp% cat foo.c
#define Blk(x)          (-x)


foo()
{
	Blk(-1);
}
oconee:tmp% gcc -E foo.c
# 1 "foo.c"

foo()
{
	         (--1) ;
}
oconee:tmp% cc -E foo.c
# 1 "foo.c"
# 6


foo()
{
	 ( - - 1 ) ;
}
#ident "acomp: (CDS) SPARCompilers 2.0.1 03 Sep 1992"
oconee:tmp% 
Technical Details
Message-ID: <9301080210.AA22873@oconee.Eng.Sun.COM>
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!sun-barr!ames!agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!eng.SUn.COM!Todd.CLayton

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!sun-barr!ames!agate!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!eng.SUn.COM!Todd.CLayton
From: Todd.CLayton@eng.SUn.COM (Todd Clayton)
Subject: GCC preprocessor bug ?
Message-ID: <9301080210.AA22873@oconee.Eng.Sun.COM>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Fri, 8 Jan 1993 02:10:44 GMT
Approved: bug-gcc@prep.ai.mit.edu
Lines: 40