[Issue 6683] Skipping declaration with goto resulted in nonsense
https://issues.dlang.org/show_bug.cgi?id=6683 Andrei Alexandrescu and...@erdani.com changed: What|Removed |Added Version|unspecified |D2 --
[Issue 6683] Skipping declaration with goto resulted in nonsense
http://d.puremagic.com/issues/show_bug.cgi?id=6683 Kasumi Hanazuki k.hanaz...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution||DUPLICATE --- Comment #4 from Kasumi Hanazuki k.hanaz...@gmail.com 2011-10-26 12:06:07 PDT --- *** This issue has been marked as a duplicate of issue 602 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6683] Skipping declaration with goto resulted in nonsense
http://d.puremagic.com/issues/show_bug.cgi?id=6683 Stewart Gordon s...@iname.com changed: What|Removed |Added Keywords||accepts-invalid CC||s...@iname.com --- Comment #5 from Stewart Gordon s...@iname.com 2011-10-26 14:11:20 PDT --- (In reply to comment #1) The spec says It is illegal for a GotoStatement to be used to skip initializations.. ( http://www.d-programming-language.org/statement.html#GotoStatement ) According to the glossary (http://www.d-programming-language.org/glossary.html), A code construct is illegal if it does not conform to the D language specification. This may be true even if the compiler or runtime fails to detect the error. For all I know, that probably means This may be true even if some compiler, because of a bug in it, fails to detect the error. So the compiler is free to ignore illegal code. Which is the bit of illegal code - the goto statement or the declaration it skips? In my experience, the compiler doesn't ignore either. Moreover, why does the spec bother to forbid anything if compiler writers are free to ignore it all? A future compiler, potentially not dmd, may indeed flag it as a compile-time error, so any behavior caused by illegal code should be regarded as unpredictable and unreliable. So you're claiming all accepts-invalid bugs are really enhancement requests? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6683] Skipping declaration with goto resulted in nonsense
http://d.puremagic.com/issues/show_bug.cgi?id=6683 bearophile_h...@eml.cc changed: What|Removed |Added CC||bearophile_h...@eml.cc --- Comment #6 from bearophile_h...@eml.cc 2011-10-26 15:10:50 PDT --- (In reply to comment #5) Moreover, why does the spec bother to forbid anything if compiler writers are free to ignore it all? Specs are meant to be long-term things. When you write the specs for a language as complex as D you are free to write things that your current working compiler is not yet able to do, or you have not yet implemented. There are several things written in D specs (or TDPL) that DMD is not yet doing. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6683] Skipping declaration with goto resulted in nonsense
http://d.puremagic.com/issues/show_bug.cgi?id=6683 Simen Kjaeraas simen.kja...@gmail.com changed: What|Removed |Added CC||simen.kja...@gmail.com --- Comment #1 from Simen Kjaeraas simen.kja...@gmail.com 2011-09-16 17:23:19 PDT --- The spec says It is illegal for a GotoStatement to be used to skip initializations.. ( http://www.d-programming-language.org/statement.html#GotoStatement ) According to the glossary (http://www.d-programming-language.org/glossary.html), A code construct is illegal if it does not conform to the D language specification. This may be true even if the compiler or runtime fails to detect the error. So the compiler is free to ignore illegal code. A future compiler, potentially not dmd, may indeed flag it as a compile-time error, so any behavior caused by illegal code should be regarded as unpredictable and unreliable. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6683] Skipping declaration with goto resulted in nonsense
http://d.puremagic.com/issues/show_bug.cgi?id=6683 --- Comment #2 from Adam D. Ruppe destructiona...@gmail.com 2011-09-16 17:38:52 PDT --- Is that saying bugs in the compiler don't override the spec or goto over initializations at your own risk? If it's the latter, this isn't a bug at all. (I can see how the compiler throwing an error on this could get annoying, so I suppose it could go both ways.) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6683] Skipping declaration with goto resulted in nonsense
http://d.puremagic.com/issues/show_bug.cgi?id=6683 --- Comment #3 from Simen Kjaeraas simen.kja...@gmail.com 2011-09-16 17:47:46 PDT --- It's the latter. Not only do you run the risk of your variables being garbage, but your code might not compile on a future compiler. (not that this has ever *not* been a problem with D, mind) The compiler is free to issue an error or not, but the code is definitely wrong. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---