On Tuesday, 7 June 2016 at 18:24:33 UTC, Walter Bright wrote:
On 6/7/2016 11:19 AM, Jack Stouffer wrote:
On Tuesday, 7 June 2016 at 18:15:28 UTC, Walter Bright wrote:
[...]
But you can't grep for @system because 99% of the time it's
implicit. This
problem becomes harder to find when using templates for
everything, which I do.
Add:
@safe:
at the top of your D module and you'll find the @system code.
The D compiler is the static analysis tool. It's true that
@safe should have been the default, but too much code would
break if that were changed. Adding one line to the top of a
module is very doable for those that are desirous of adding the
safety checks.
You can also add:
@nogc:
at the top, too. It isn't necessary to tediously annotate every
function.
Seems fair. But perhaps phobos should also follow this standard?
Which might be why people get the mindset that they have to
annotate everything...