From 46f08a600d7a163bd1c1d0df87d603d8275490e9 Mon Sep 17 00:00:00 2001 From: Paul Backus Date: Fri, 22 May 2020 14:32:56 -0400 Subject: [PATCH] Add explicit @system attribute to extern functions Needed for compatibility with @safe-by-default. --- src/core/internal/parseoptions.d | 2 +- src/rt/config.d | 2 +- test/exceptions/src/rt_trap_exceptions.d | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/internal/parseoptions.d b/src/core/internal/parseoptions.d index ca66ae9580..b03c07bf33 100644 --- a/src/core/internal/parseoptions.d +++ b/src/core/internal/parseoptions.d @@ -18,7 +18,7 @@ import core.internal.traits : externDFunc; @nogc nothrow: -extern extern(C) string[] rt_args(); +extern extern(C) string[] rt_args() @system; extern extern(C) __gshared bool rt_envvars_enabled; extern extern(C) __gshared bool rt_cmdline_enabled; diff --git a/src/rt/config.d b/src/rt/config.d index 2509465c26..f7682f31b6 100644 --- a/src/rt/config.d +++ b/src/rt/config.d @@ -61,7 +61,7 @@ import core.stdc.ctype : toupper; import core.stdc.stdlib : getenv; import core.stdc.string : strlen; -extern extern(C) string[] rt_args() @nogc nothrow; +extern extern(C) string[] rt_args() @nogc nothrow @system; alias rt_configCallBack = string delegate(string) @nogc nothrow; diff --git a/test/exceptions/src/rt_trap_exceptions.d b/test/exceptions/src/rt_trap_exceptions.d index ca9ae9cde8..b765d31db9 100644 --- a/test/exceptions/src/rt_trap_exceptions.d +++ b/test/exceptions/src/rt_trap_exceptions.d @@ -1,7 +1,7 @@ // Code adapted from // http://arsdnet.net/this-week-in-d/2016-aug-07.html extern extern(C) __gshared bool rt_trapExceptions; -extern extern(C) int _d_run_main(int, char**, void*); +extern extern(C) int _d_run_main(int, char**, void*) @system; extern(C) int main(int argc, char** argv) { rt_trapExceptions = false;