This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
That's correct. The compiler makes an exception to the rule that prohibits unreachable code for if() statements to support conditional compilation. Otherwise, it is no different from while or do while.
Sri Sri, I just want to add that do.. while(false) works fine just like if(false). This is because the compiler knows that do ... while(false) gets executed at least once. for(;false gives compiler error just like while(false). This is because the code with in for loop never gets executed so compiler throws an error message stating that the code is not reachable. Even if the code in these cases is just a null statement represented by ;