www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1181] New: DMD requires initializer for struct that shouldn't need one

reply d-bugmail puremagic.com writes:

           Summary: DMD requires initializer for struct that shouldn't need
           Product: D
           Version: 1.013
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: link-failure
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: sean f4.ca

The presence of the "= void" in Wrap below should obviate the need for an

C:\code\src\d\bugs>cat hdr.d
struct Data
    double val;

struct Wrap
    Data data = void;

C:\code\src\d\bugs>cat app.d
import hdr;

void main()
    Wrap w;

C:\code\src\d\bugs>dmd app
c:\bin\dmd\bin\..\..\dm\bin\link.exe app,,,user32+kernel32/noi+tango.lib;
OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

 Error 42: Symbol Undefined _D3hdr4Wrap6__initZ
--- errorlevel 1


Apr 23 2007
parent d-bugmail puremagic.com writes:

thomas-dloop kuehne.cn changed:

           What    |Removed                     |Added
         OS/Version|Windows                     |All

------- Comment #1 from thomas-dloop kuehne.cn  2007-04-27 12:37 -------
If optimization is enabled ("-O") the above code can be linked.

Apr 27 2007