2 ms·
> incorrectly be flagged as unsafe It depends on what that means. For example, one can write perfectly correct code in a block of code marked "unsafe", it's ju
by WalterBright 7y ago
> incorrectly be flagged as unsafe
It depends on what that means. For example, one can write perfectly correct code in a block of code marked "unsafe", it's just that the compiler cannot check it. In D, these are marked with the @system attribute.
We actually had a discussion about what to call such unsafe blocks. Other languages call them "unsafe", but I didn't care for that as it implied the blocks were actually broken. Hence we call such code "system" code.
There aren't false negatives by the design of the rules. This is different from what linters do, as linters issue warnings for code that is acceptable by the language rules.
- exiled13 7y ago> Other languages call them "unsafe", but I didn't care for that as it implied the blocks were actually broken. Climbing a ladder on a table is unsafe. Does that imply the ladder or table is broken? No.