Why does hello world not compile in safe?

bearophile via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Nov 29 02:26:31 PST 2014


Freddy:

> ----
> import std.stdio;
> @safe:
> void main()
> {
> 	writeln("Edit source/app.d to start your project.");
> }
>
> ----
> source/app.d(5): Error: safe function 'D main' cannot call 
> system
> function 'std.stdio.writeln!(string).writeln'

With the latest dmd compiler this compiles fine.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list