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:
http://d.puremagic.com/issues/show_bug.cgi?id=1181

           Summary: DMD requires initializer for struct that shouldn't need
                    one
           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
initializer.


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

app.obj(app)
 Error 42: Symbol Undefined _D3hdr4Wrap6__initZ
--- errorlevel 1

C:\code\src\d\bugs>


-- 
Apr 23 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1181


thomas-dloop kuehne.cn changed:

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





If optimization is enabled ("-O") the above code can be linked.


-- 
Apr 27 2007
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1181


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich gmail.com
            Version|1.013                       |D1 & D2



11:17:16 PST ---
This is also a D2 bug.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 22 2013