Bug 2592 – Cast in std.stdio disallowed in safe mode

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2009-01-18T15:42:00Z
Last change time
2015-06-09T01:20:50Z
Assigned to
andrei
Creator
andrew.talbot

Comments

Comment #0 by andrew.talbot — 2009-01-18T15:42:06Z
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 by andrew.talbot — 2009-05-12T13:32:17Z
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 by andrei — 2010-09-26T12:09:38Z
Fixed a while ago.