Switch case falltrhough, regression or intended behavior ?
Stewart Gordon
smjg_1998 at yahoo.com
Mon Feb 25 16:14:23 PST 2013
On 25/02/2013 02:01, Jonathan M Davis wrote:
<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.
>
> That behavior is on purpose. It really is meant that the warnings be treated
> exactly as errors. I pointed out this particular issue to Walter in the past
> (within the past month even IIRC), and he agreed that it wasn't good, but it
> was clear from what he said that it was the intended behavior and not a bug.
So according to what you're saying, it's deliberate that -w doesn't
compile D, but rather a vendor-specific language that is confusingly
similar to D and admits some code that is legal in D with different
behaviour.
Please supply a link to Walter's statement.
> The problem is really that -w exists at all.
Together with the omission of a switch that simply causes warnings to be
emitted and then returns an error status if any were.
Stewart.
More information about the Digitalmars-d
mailing list