void xx(char cc) { char aa; switch(cc) { case 1:case 0: aa=1; break; case 2,3: aa=2; break; } }
//----------------------------------
xx(0); //run OK xx(1); //run OK xx(2); //run FAIL <<***************** xx(3); //run OK
0 Error(s) 0 warning(s) ,you can step test
No need to step test. It doesn't matter if the compiler should have accepted that expression or not. The source code is incorrect. And you can't expect correct behaviour if the source code is incorrect.
0 Error(s) 0 warning(s) ,you can step test I know of no C compiler that catches and report each and every possible mistake.
Erik