cause:
test.c(1) : fatal error C1017: invalid integer constant expression
when compiled by cl.exe aka "Microsoft (R) 32-bit C/C++ Optimizing
Compiler Version 15.00.30729.01 for 80x86".
On the other hand this compile and runs fine.
#if 0?(0?0:0):0
#endif
int main(void){return 0?0?0:0:0;}
Did I hit a but it this compiler's preprocessor?
Francois Grieu
Looks like ig.
--
Eric Sosman
eso...@ieee-dot-org.invalid
The consensus is yes. I duly reported it. And the (representative of)
the compiler vendor says: "We were able to reproduce this issue. But
Unfortunately we will not fix this issue as it is not a common code and
is not a high priority issue. Thanks for playing with our product."
I should probably have reported the problem as:
// return the smallest of x y z
#define MIN3(x,y,z) ( (x)>(y) ? (y)>(z) ? (z) : (y) : (x) )
#define ALPHA 5
#define BETA 4
#define GAMMA 6
#if MIN3(ALPHA,BETA,GAMMA) < 2
#error "check ALPHA BETA GAMMA"
#endif
int main(void){return 0?0?0:0:0;}
Francois Grieu