www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4315] New: Invalid object file created when appending const char[0] to char[]

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4315

           Summary: Invalid object file created when appending const
                    char[0] to char[]
           Product: D
           Version: D1
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: torhu yahoo.com


--- Comment #0 from torhu yahoo.com 2010-06-14 16:17:35 PDT ---
DMD 1.061.

---
void main()
{
    char[] a;
    const b = "";

    //const char[0] b; // fails
    //char[0] b;  // ok
    //const b = "x";  // ok
    //const char[] b = "";  // ok
    //auto b = "";  // ok

    a ~= b;
}
---

Output:

d:\prog\test\D\matheval>dmd -run test
OPTLINK (R) for Win32  Release 8.00.1
Copyright (C) Digital Mars 1989-2004  All rights reserved.
test.obj(test)  Offset 0018FH Record Type 009D
 Error 16: Index Range
--- errorlevel 1


optlink 8.00.2 silently ignores this error, I'll create another bug report for
that.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 14 2010
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4315


nfxjfg gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
                 CC|                            |nfxjfg gmail.com


--- Comment #1 from nfxjfg gmail.com 2010-06-14 16:31:53 PDT ---
Under Linux, with 1.062, I get:
Error: no definition for static _D2fd4mainFZv1bG0a
It's not even a linker error.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 14 2010