Bug 5584 – bad string representation of function types with C/Windows linkage
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-02-15T00:06:00Z
Last change time
2012-04-25T23:15:19Z
Keywords
patch
Assigned to
nobody
Creator
r.sagitario
Comments
Comment #0 by r.sagitario — 2011-02-15T00:06:16Z
This code
extern(C) void fnC() {}
extern(Windows) void fnWindows() {}
pragma(msg,typeof(fnC));
pragma(msg,typeof(fnWindows));
compiled with "dmd -c test.d" outputs:
voidC ()
voidWindows ()
with bad space placement. This is also the type emitted into the json file.
Here's the simple patch that corrects the spacing:
File: src\mtype.c
4734,4737c4734,4737
< case LINKc: p = "C "; break;
< case LINKwindows: p = "Windows "; break;
< case LINKpascal: p = "Pascal "; break;
< case LINKcpp: p = "C++ "; break;
---
> case LINKc: p = " C"; break;
> case LINKwindows: p = " Windows"; break;
> case LINKpascal: p = " Pascal"; break;
> case LINKcpp: p = " C++"; break;
Problably, it should better output extern(C) etc. before the return type...