December 26, 2020 [Issue 21503] New: Incorrect C main signature causes undefined behavior in @safe code | ||||
|---|---|---|---|---|
| ||||
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: nobody@puremagic.com Reporter: snarwin+bugzilla@gmail.com 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. -- | ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply