D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 2592 - Cast in std.stdio disallowed in safe mode
Summary: Cast in std.stdio disallowed in safe mode
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86 Linux
: P2 normal
Assignee: Andrei Alexandrescu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-18 15:42 UTC by Andrew Talbot
Modified: 2015-06-09 01:20 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 Andrew Talbot 2009-01-18 15:42:06 UTC
When the following program is compiled using dmd with the "safe" switch set, it produces the error message: "/usr/local/src/phobos/std/c/linux/linux.d(280): Error: cast from int to void* not allowed in safe mode"

import std.stdio;

void main() { }

This bug persists for dmd version 2.023.
Comment 1 Andrew Talbot 2009-05-12 13:32:17 UTC
In the current version of D2 (version 2.030) the casts that cause safe mode compilation to fail when std.stdio is imported are now to be found in .../druntime/import/core/stdc/signal.d, the following error messages being produced.

/usr/local/src/druntime/import/core/stdc/signal.d(25): Error: cast from int to voidC  function(int) not allowed in safe mode
/usr/local/src/druntime/import/core/stdc/signal.d(26): Error: cast from int to voidC  function(int) not allowed in safe mode
/usr/local/src/druntime/import/core/stdc/signal.d(27): Error: cast from int to voidC  function(int) not allowed in safe mode
Comment 2 Andrei Alexandrescu 2010-09-26 12:09:38 UTC
Fixed a while ago.