On 11/3/2014 10:03 AM, Nick Treleaven wrote:
On 02/11/2014 20:33, Walter Bright wrote:
It's simply not workable to put a wall between them. Every proposal for
it has entailed various unfortunate, ugly, and arbitrary consequences.

We need warnings like gcc has:

"-Wsign-compare
     Warn when a comparison between signed and unsigned values could produce an
incorrect result when the signed value is converted to unsigned.

-Wconversion
     Warn for implicit conversions that may alter a value. This includes ...
conversions between signed and unsigned, like unsigned ui = -1 ... Warnings
about conversions between signed and unsigned integers can be disabled by using
-Wno-sign-conversion.
"

I find these to suffer from the same problems as all the proposals to "fix" the issue - they motivate the user to "fix" them with unfortunate, ugly, and arbitrary consequences.

We need to be very careful with the idea of "just add a warning". Warnings are a sure sign of wishy-washy language design where the designers cannot make up their mind, so they dump it on the user. One person's warning become another person's must fix, and the language becomes balkanized, which is not good for portability, comprehensibility, and best practices.

It is really unfortunate that D is more bug-prone than gcc in this case.

I'm afraid that is a matter of opinion.

There was some promising work here:

https://github.com/D-Programming-Language/dmd/pull/1913

Reply via email to