June 30, 2013 [Issue 10147] Make -w identical to -wi and deprecate it | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis | http://d.puremagic.com/issues/show_bug.cgi?id=10147 --- Comment #10 from bearophile_hugs@eml.cc 2013-06-29 17:34:16 PDT --- (In reply to comment #9) > Hmm thinking about this some more I think the only reason I've ever needed -w was because of issues like missing default switch and switch case fall-through (and perhaps missing override keyword), which IIRC used to be warnings but are now finally deprecated behavior. > > Some warnings in DMD should have been errors from the get-go. I don't think many (if any?) warnings are left that should be errors, and this was the only reason why I needed -w. Some new warnings (and later deprecations) will be added because there are more than one thousand issues open and some of them are about small D design mistakes that I really hope will eventually be fixed. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
June 30, 2013 [Issue 10147] Make -w identical to -wi and deprecate it | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis | http://d.puremagic.com/issues/show_bug.cgi?id=10147 monarchdodra@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |monarchdodra@gmail.com --- Comment #11 from monarchdodra@gmail.com 2013-06-30 00:11:18 PDT --- (In reply to comment #2) > > Can you please be more specific, maybe with example code? I have no knowledge of any of this. > > Okay. Let's say that you have a function like > > [...] > > _Anything_ that tests whether code compiles potentially breaks thanks to -w. How big a problem this is in practice, I don't know, but -w can change the semantics of code, meaning that whether you compile with -w or not effectively creates two different languages. Normally, we reject any suggestions that involve flags like this. -w really makes no sense. Couldn't we instead "fix" "-w" ? Currently, it transforms any warning into an error, creating the above mentioned problem. What we *really* want (as stated by Andrej) is simply for compilation to halt on the first reported warning. If we simply "upgrade" -w to work as in "if a warning is *emitted*, then translate that warning into an error, and then halt compilation. This means we'd have 100% the same behavior between "", "-w", "-wi", but still get the behavior of "I refuse to compile until you process this warning". I'm not compiler savvy, so wouldn't know how easy it is to improve it to do this, but it seems better than to simply deprecate it... -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
June 30, 2013 [Issue 10147] Make -w identical to -wi and deprecate it | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis | http://d.puremagic.com/issues/show_bug.cgi?id=10147 Dicebot <m.strashun@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.strashun@gmail.com --- Comment #12 from Dicebot <m.strashun@gmail.com> 2013-06-30 00:57:51 PDT --- I consider the very existence of warnings a mistake. Their use cases are completely taken over by static analysis tools. I think the idea solution would have been to go through the list of warnings and make some of them errors. Remaining ones should stay available only as -wi and once standard static analysis tool will appear - completely moved there. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
June 30, 2013 [Issue 10147] Make -w identical to -wi and deprecate it | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis | http://d.puremagic.com/issues/show_bug.cgi?id=10147 --- Comment #13 from Jonathan M Davis <jmdavisProg@gmx.com> 2013-06-30 03:27:18 PDT --- I would _love_ it if we got rid of warnings completely, and I know that Walter has similar feelings. I believe that we have them primarily because Walter got bullied into it, and that's likely why dmd has such abnormal behavior with regards to warnings. What every other compiler I've ever used does is _always_ emit warnings, and if there's a flag for making them errors, it's not normally used. Warnings are horrible, because they aren't things that are necessarily actually wrong, and yet you're then forced to fix them, because it's bad practice (and hides legitimate problems) if you leave a bunch of warnings in your code. So, ultimately, there's not much difference between an error and a warning. We'd be _far_ better off without them. I completely agree with Dicebot that anything which is not _guaranteed_ to be wrong should be done with a static analysis tool. That being said, if we're stuck with -w and/or -wi, -w needs to fixed - either by fixing its behavior so that it has no effect on conditional compilation or by getting rid of it in favor of just having -wi. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation