🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #2901

gcc preprocessor bug (?)

#2901
From: Rob Cunningham
Date: Mon, 26 Feb 1990 15:07
72 lines
1413 bytes
While trying to use gcc to compile various sunview things (under sunos 4.0.3)
I ran into the recent problem with gcc's preprocessor, and sun's CAT macro.
In condensed form, here's what it looks like:

/* Start of "C" file */
#ifndef	CAT
#undef	IDENT
#define IDENT(x)	x
#define	CAT(a,b)	IDENT(a)b
#endif

main()
{
  int name_data;

  CAT(name,_data) = 5;
  
  printf("%d\n",name_data);
}

Here's the output from pcc -E:
# 1 "temp.c" 










main()
{
  int name_data;

  name_data = 5;
  
  printf("%d\n",name_data);
}

Here's the output from gcc -E:
# 1 "temp.c"
 









main()
{
  int name_data;

  name _data  = 5;
  
  printf("%d\n",name_data);
}
/* End of output */
 NOTE THE name<space>_data line--
the space between the name and data makes it impossible to use this macro with
gcc (and thus to use gcc with sun's include files.)

 	As I'm not a compiler guru, I don't know how to fix the problem, but I
hope someone who does can fix it.
	-Rob


	
Technical Details
Message-ID: <9002261507.AA17813@XN.LL.MIT.EDU>
Path: arc1-ca.pugleaf.net!utzoo!telly!philmtl!uunet!bu.edu!spdcc!snorkelwacker!tut.cis.ohio-state.edu!XN.LL.MIT.EDU!rkc

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!philmtl!uunet!bu.edu!spdcc!snorkelwacker!tut.cis.ohio-state.edu!XN.LL.MIT.EDU!rkc
From: rkc@XN.LL.MIT.EDU (Rob Cunningham)
Newsgroups: gnu.gcc.bug
Subject: gcc preprocessor bug (?)
Message-ID: <9002261507.AA17813@XN.LL.MIT.EDU>
Date: 26 Feb 90 15:07:31 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 72