[Issue 14643] Safety violation with final switch and void initializer
https://issues.dlang.org/show_bug.cgi?id=14643 Nick Treleaven changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |DUPLICATE --- Comment #4 from Nick Treleaven --- *** This issue has been marked as a duplicate of issue 11051 *** --
[Issue 14643] Safety violation with final switch and void initializer
https://issues.dlang.org/show_bug.cgi?id=14643 Nick Treleaven changed: What|Removed |Added See Also||https://issues.dlang.org/sh ||ow_bug.cgi?id=11051 --
[Issue 14643] Safety violation with final switch and void initializer
https://issues.dlang.org/show_bug.cgi?id=14643 --- Comment #3 from Nick Treleaven --- > the bug might not even be reproducible Oops, the original bug also violates safety anyway. The above comment combined with the original example means that any enum value outside its min and max properties can produce an uninitialized pointer in safe code, void initialization is not required. The solution seems to be to fix issue 11051. --
[Issue 14643] Safety violation with final switch and void initializer
https://issues.dlang.org/show_bug.cgi?id=14643 Nick Treleaven changed: What|Removed |Added CC||n...@geany.org --- Comment #2 from Nick Treleaven --- Note that an enum E is allowed to take values larger than E.max using binary operations: enum E { a, b} pragma(msg, E.max); // E.b which is 1 E value = E.b << E.b; // 2 So that violates `final switch` anyway, even in @safe code, and casting can (see https://issues.dlang.org/show_bug.cgi?id=11051#c7). Though void initialization is worse because the bug might not even be reproducible. Sadly void initialization is not banned in @safe. --
[Issue 14643] Safety violation with final switch and void initializer
https://issues.dlang.org/show_bug.cgi?id=14643 Iain Buclaw changed: What|Removed |Added Priority|P1 |P3 --
[Issue 14643] Safety violation with final switch and void initializer
https://issues.dlang.org/show_bug.cgi?id=14643 Radu Racariuchanged: What|Removed |Added Keywords||safe CC||radu.raca...@gmail.com --
[Issue 14643] Safety violation with final switch and void initializer
https://issues.dlang.org/show_bug.cgi?id=14643 --- Comment #1 from Dicebot pub...@dicebot.lv --- correction : foo() needs to be called twice to start getting garbage on stack --