Skip to content

Commit 29704b0

Browse files
authored
Merge pull request #2900 from WalterBright/SystemFunctions
Improve wording of System Functions section
2 parents fb42caa + 9f7c771 commit 29704b0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

spec/function.dd

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3047,18 +3047,22 @@ $(H3 $(LNAME2 system-functions, System Functions))
30473047
and are not nested inside $(CODE @safe) functions.
30483048
System functions may be marked with the $(CODE @system) attribute.
30493049
A function being system does not mean it actually is unsafe, it just
3050-
means that the compiler is unable to verify that it cannot exhibit
3051-
undefined behavior.
3050+
means that its safety must be manually verified.
30523051
)
30533052

30543053
$(P System functions are $(B not) covariant with trusted or safe functions.
30553054
)
30563055

3056+
$(P System functions can call safe and trusted functions.)
3057+
30573058
$(BEST_PRACTICE When in doubt, mark `extern (C)` and `extern (C++)` functions as
30583059
`@system` when their implementations are not in D, as the D compiler will be
30593060
unable to check them. Most of them are `@safe`, but will need to be manually
30603061
checked.)
30613062

3063+
$(BEST_PRACTICE The number and size of system functions should be minimized.
3064+
This minimizes the work necessary to manually check for safety.)
3065+
30623066
$(H3 $(LNAME2 safe-interfaces, Safe Interfaces))
30633067

30643068
$(P Given that it is only called with $(RELATIVE_LINK2 safe-values, safe

0 commit comments

Comments
 (0)