In the function:
void DoSomething(int a, int b) {
SomeOtherFunction(a); }
The compiler (C166) generates the warning unused parameter b. So I tried:
b;
And get warning expression with possibly no effect. So I tried:
void DoSomething(int a, int /*b*/) {
And got warning non standard extension - unnamed parameter!
Anybody got any other ideas?
I think that the conclusion from this thread is that the solution is not portable - because what "works" on one compiler may not on another.
To make it "portable", you'd need comditional-compilation to select the appropriate construct for the particular compiler...
But the technique of wrapping an "executable" macro in do{...}while(0) is a common one:
c-faq.com/.../multistmt.html