https://issues.dlang.org/show_bug.cgi?id=21503
Issue ID: 21503
Summary: Incorrect C main signature causes undefined behavior
in @safe code
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
Example program:
---
extern(C) void main(double[] foo) @safe
{
import std.stdio;
writeln(foo); // undefined behavior
}
---
To avoid this, the compiler should check the signature of a @safe extern(C)
main function for conformance to the C standard.
--