On 4/9/2013 11:22 AM, Jonathan M Davis wrote:
No. As I understand it, Walter is against adding flags like that to dmd. He doesn't want a lot of stray flags which affect what is and isn't a warning and the like. He doesn't even like the fact that warnings exist in the first place - which I'm inclined to agree with. If it's something that has to be fixed, it should be an error, and if it doesn't have to be fix, don't warn about it, because any good programmer is going to have to fix all of the warnings anyway, ultimately making it not much different from an error anyway. Stuff like you're suggesting really should be left up to lint-like tools.
Yes, that's an accurate assessment of my opinion on the matter. Warnings are a sign that one has made a mistake in the language design. That's perfectly acceptable in, say, C, where there are many known mistakes but the C Standards committee finds it impractical to fix. Hence, warnings become the most reasonable avenue to improve the language.
In D we have the opportunity to fix. Warnings in D are often proposed when reasonable people do not agree on what the correct behavior of the language should be, but I regard such compromises as a copout.
Another bad problem with warnings (and we also have this issue with deprecation errors) is an increasing amount of D code relies on asking the question "does this expression compile without errors". A lot of sand gets thrown in those gears with compiler switches that turn language features on and off.