http://d.puremagic.com/issues/show_bug.cgi?id=2467
Summary: strtol() is improperly declared Product: D Version: 1.030 Platform: PC OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: Phobos AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] In dmd/src/phobos/std/c/stdlib.d, the following declaration is wrong: long strtol(char *,char **,int); /// ditto it should be declared with an 32-bit "int" return value. Declared as "long", whatever value EDX happens to have upon strtol()'s return gets stuffed into the upper 32-bits of a 64-bit return value. My test case demonstrates this: import std.stdio; import std.c.stdlib; void main(string[] args) { writefln("%x", strtol("55555555", null, 16)); assert(strtol("55555555", null, 16) == 0x55555555L); } The output is: 41ba3a55555555 Error: AssertError Failure a(5) --