D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3406 - [tdpl] Cannot compile "Hello, world" or even less with -safe
Summary: [tdpl] Cannot compile "Hello, world" or even less with -safe
Status: RESOLVED WONTFIX
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Linux
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-15 17:23 UTC by Andrei Alexandrescu
Modified: 2015-06-09 05:15 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Andrei Alexandrescu 2009-10-15 17:23:52 UTC
This program:

import std.stdio;

void main() {
}

fails to compile if the -safe switch is used with the error:

/home/andrei/code/dmd/druntime/import/core/stdc/signal.d(25): Error: cast from int to void C function(int) not allowed in safe mode
/home/andrei/code/dmd/druntime/import/core/stdc/signal.d(26): Error: cast from int to void C function(int) not allowed in safe mode
/home/andrei/code/dmd/druntime/import/core/stdc/signal.d(27): Error: cast from int to void C function(int) not allowed in safe mode

We must define and implement the Trusted Computing Base model for druntime and phobos.
Comment 1 Walter Bright 2009-11-21 02:17:12 UTC
The -safe switch will be replaced by @safe function attributes.