[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::decc

Title:DECC
Notice:General DEC C discussions
Moderator:TLE::D_SMITHNTE
Created:Fri Nov 13 1992
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2212
Total number of notes:11045

2157.0. "C preprocessor problem with macro expansion." by AUBER::LORENZO (Philippe LORENZO: EVRY FRANCE TSSC Ultrix) Tue Apr 22 1997 05:57

	Hello,

	I don't know if it is an already known problem.

	Here is a sample program which shows a  problem
	with the gem_c preprocessor.

$ cat foo.c
#define dotimespC dotimespW
#define dotimespW(c,n,s) { unsigned short c = (n); while (--c > 0) { s } }
void foo (int x, int y, char** p)
{ dotimespC(a,x, { dotimespC(b,y, { *p++ = 0; }); }); }

$ cc -std -E foo.c
# 1 "foo.c"


void foo (int x, int y, char** p)
{ { unsigned short a = (x); while (--a > 0) { { dotimespC(b,y, { *p++ = 0; }); } } }; }

	The inner `dotimespC' macro is not being expanded.

# uname -a
OSF1 archimede.evt.dec.com V4.0 564 alpha

# /usr/lib/cmplrs/cc/gemc_cc -V
DEC C V5.2-033 on Digital UNIX V4.0 (Rev. 564)

	Thanks for any help.

Philippe.
T.RTitleUserPersonal
Name
DateLines
2157.1Fixed in next Digital UNIX 4.0 minor releaseDECC::SULLIVANJeff SullivanTue Apr 22 1997 11:0425
This should be fixed in the DEC C that will be shipped with the "Platinum Minor"
release. See below.

% cc -E -std foo.c             
# 1 "foo.c"


void foo (int x, int y, char** p)
{  { unsigned short a = ( x ) ; while ( -- a > 0 ) { { { unsigned short b = ( y
) ; while ( -- b > 0 ) { { * p ++ = 0 ; } } } ; } } } ; }

% /usr/lib/cmplrs/cc/gemc_cc -V
DEC C V5.6-059 on Digital UNIX V4.0 (Rev. 386)


This compiler is available for field testing at:

  http://www.zk3.dec.com/decc/decc-kitinfo.html

Take a look at the README referenced there.
I will add your test case to our regression test system as decc_2157.

Thanks for reporting the problem.

-Jeff
2157.2Thank you for your fast reply.AUBER::LORENZOPhilippe LORENZO: EVRY FRANCE TSSC UltrixTue Apr 22 1997 11:210