mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 05:00:16 +03:00
Improve -preview=safer
changelog entry (#17490)
This commit is contained in:
parent
2674d225aa
commit
a13b00fab1
1 changed files with 20 additions and 1 deletions
|
@ -1,3 +1,22 @@
|
|||
This adds `-preview=safer` which enables safety checking on un-attributed functions.
|
||||
Add `-preview=safer` switch for safety checking on unattributed functions
|
||||
|
||||
All the checks currently enabled in `@safe` code, that are easily fixed (as in
|
||||
the fix is constrained to the function), will be enabled in `-preview=safer` code.
|
||||
|
||||
Code not easily fixed, such as calls to `@system` or unattributed functions, will
|
||||
be allowed as before.
|
||||
|
||||
---
|
||||
void f();
|
||||
@system void g();
|
||||
|
||||
void main()
|
||||
{
|
||||
int* p;
|
||||
p++; // Error, pointer arithmetic
|
||||
f(); // allowed
|
||||
g(); // allowed
|
||||
}
|
||||
---
|
||||
|
||||
For more information, see: [safer.md](https://github.com/WalterBright/documents/blob/38f0a846726b571f8108f6e63e5e217b91421c86/safer.md)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue