I am wondering if all compilers will silently ignore the code before the shortcuts in the switch statement, as VS2005 does.
This is what I need:
#define CASE break; case
So,
switch (i) { CASE 0: print("0"); CASE 1: print("1"); }
will turn into
switch (i) { break; case 0: print("0"); break; case 1: print("1"); }
From the standard it seems obvious that the first "break" (and any other code there, if it existed) will not be executed. The standard does not deny the existence of such code, but I cannot be sure of real compilers.
source share