🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Todd Clayton Fri, 08 Jan 1993 02:10
GCC preprocessor bug ?
#1607
Author: 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% 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads