Switch case falltrhough, regression or intended behavior ?

Stewart Gordon smjg_1998 at yahoo.com
Sun Feb 24 17:42:10 PST 2013


On 18/02/2013 01:21, Stewart Gordon wrote:
> On 17/02/2013 21:46, Jonathan M Davis wrote:
<snip>
>> Probably because -w turns warnings into errors. That's its whole schtick.
>
> No, the whole schtick of -w is that it causes warnings to be emitted at all.  It's a quirk
> of the way it was designed that it treats them as errors - by returning a failure status
> code, not by the wording of the compiler output.
<snip>

There's a more important way in which it isn't quite "treat warnings as errors": if you 
use an IsExpression to test the validity of a snippet of code, a pass with warnings must 
still be a pass.  Otherwise, you'll get code that compiles with or without -w, but behaves 
differently in each case.  There have been bugs in DMD in this respect - I'm not sure if 
there still are.

Stewart.


More information about the Digitalmars-d mailing list