Bug 4315 – Invalid object file created when appending const char[0] to char[]
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2010-06-14T16:17:35Z
Last change time
2017-10-25T03:05:38Z
Keywords
link-failure, rejects-valid
Assigned to
No Owner
Creator
torhu
Comments
Comment #0 by torhu — 2010-06-14T16:17:35Z
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.
Comment #1 by nfxjfg — 2010-06-14T16:31:53Z
Under Linux, with 1.062, I get:
Error: no definition for static _D2fd4mainFZv1bG0a
It's not even a linker error.
Comment #2 by tetyys — 2017-04-09T07:55:24Z
i think that's no longer a valid bug, compiles normally as of this decade