In another thread, on the sad state of standards-conformance in C
(and C++) compilers, and varying degree of willingness to progress
on that in compiler vendors, I wrote:
A non-obscure compiler (if you visualize what I mean) won't compile:
// 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
The (representative of the) vendor's comment on that bug: "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."
A "Quality Assurance" representative for that compiler added: "Though
the case you reference is more common, since it is wrapped in a macro,
it is fairly trivial to apply the workaround you provided [adding
parenthesis]. Especially given the workaround, we do not view this
issue as one that affects a significant number of customers, and have
chosen to prioritize it below other, more serious, issues.
https://connect.microsoft.com/VisualStudio/feedback/details/546053
The aspiration to make a bug-free program seems gone; even though,
in the case of at least the preprocessor, it seems something a single
person could fulfill in at most a few weeks of work.
Comments and other experiences welcome. Also, feel free to vote at
the above URL on what you think should be done.
Francois Grieu