[Search for users]
[Overall Top Noters]
[List of all Conferences]
[Download this site]
Title: | DECC |
Notice: | General DEC C discussions |
Moderator: | TLE::D_SMITH N TE |
|
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.R | Title | User | Personal Name | Date | Lines |
---|
2157.1 | Fixed in next Digital UNIX 4.0 minor release | DECC::SULLIVAN | Jeff Sullivan | Tue Apr 22 1997 11:04 | 25 |
| 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.2 | Thank you for your fast reply. | AUBER::LORENZO | Philippe LORENZO: EVRY FRANCE TSSC Ultrix | Tue Apr 22 1997 11:21 | 0
|