Both safe and wrong?
Rubn
where at is.this
Mon Feb 4 00:35:43 UTC 2019
On Monday, 4 February 2019 at 00:29:04 UTC, Luís Marques wrote:
> On Monday, 4 February 2019 at 00:18:48 UTC, ag0aep6g wrote:
>> The thing here is that the @safe attribute only applies to
>> functions. `int* y = cast(int*) &x;` is not a function
>> declaration, so `@safe:` has no effect on it.
>
> Gotcha. It's disappointing that there is no way to mark an
> entire module as safe. Also seems a bit inconsistent with other
> attributes marked with the "attribute:" syntax, which apply
> more broadly.
Walter is extremely against the idea of
@safe module std.stdio;
It's kind of ironic that you can't have @safe code that's not in
a function. Kind of seems like a gigantic hole in creating a safe
language.
More information about the Digitalmars-d
mailing list