Thread overview
Warnings for DDMD source
Feb 27, 2016
Johan Engelen
Feb 27, 2016
Johan Engelen
Feb 27, 2016
Johan Engelen
February 27, 2016
I'd like to enable warnings for building DDMD  (-w, or -wi if there is too much debate).

The outputted warnings will depend on the D compiler used, but at least using "-wi" may improve code quality I think.

Right now, there are a bunch of switch case warnings, e.g.:
argtypes.d(296): Warning: switch case fallthrough - use 'goto case;' if intended
argtypes.d(304): Warning: switch case fallthrough - use 'goto case;' if intended
canthrow.d(149): Warning: switch case fallthrough - use 'goto default;' if intended
dcast.d(363): Warning: switch case fallthrough - use 'goto case;' if intended
dcast.d(377): Warning: switch case fallthrough - use 'goto case;' if intended
dcast.d(463): Warning: switch case fallthrough - use 'goto default;' if intended
dcast.d(604): Warning: switch case fallthrough - use 'goto case;' if intended

And there is a funny:
target.d(269): Warning: statement is not reachable
on the line:
269:          return null; // avoid warning

These warnings are easily fixed and (for me) improve legibility.

Let me know what you think. I'm happy to submit a PR. In fact, why don't I do it right now, while you debate about it.
February 27, 2016
On Saturday, 27 February 2016 at 12:18:19 UTC, Johan Engelen wrote:
> I'd like to enable warnings for building DDMD

Forgot to note that one of the reasons for this is that warnings can be very useful for us working downstream on LDC. They can quickly point to merge error locations / code locations where we should work on.
February 27, 2016
On Saturday, 27 February 2016 at 12:18:19 UTC, Johan Engelen wrote:
> Let me know what you think. I'm happy to submit a PR. In fact, why don't I do it right now, while you debate about it.

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