Both safe and wrong?

Luís Marques luis at luismarques.eu
Mon Feb 4 00:29:04 UTC 2019


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.


More information about the Digitalmars-d mailing list