digitalmars.D.bugs - [Issue 2686] New: Invalid union initializer is accepted
- d-bugmail puremagic.com (28/29) Feb 24 2009 http://d.puremagic.com/issues/show_bug.cgi?id=2686
- d-bugmail puremagic.com (12/12) Apr 14 2011 http://d.puremagic.com/issues/show_bug.cgi?id=2686
http://d.puremagic.com/issues/show_bug.cgi?id=2686 Summary: Invalid union initializer is accepted Product: D Version: 1.040 Platform: PC OS/Version: Windows Status: NEW Keywords: accepts-invalid Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: snake.scaly gmail.com ------8<------- bug.d ---- static import std.stdio; union A { short a; long b; } void main() { A x = 0x12345; std.stdio.writefln("a %s, b %s", x.a, x.b); } ------8<------- bug.d ----dmd -run bug.da 0, b 0 A simple numeric initializer is accepted but union members are not initialized accordingly. This should be a compile-time error. --
Feb 24 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2686 Don <clugdbug yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |clugdbug yahoo.com.au Resolution| |FIXED This was fixed in DMD1.050 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 14 2011