You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some builtin functions can cause undefined behavior or subvert the Zig type system.
I think these builtin functions should be clearly marked.
Here is a list, probably incomplete:
@addrSpaceCast
The documentation says that the operation may be illegal. What is the difference from undefined behavior?
There is no documentation in the "Undefined Behavior" section.
@ptrCast
The documentation says:
"Casting an optional pointer which is null to a non-optional pointer invokes safety-checked Undefined Behavior".
An additional warning is in the "volatile" section:
"To convert one pointer type to another, use @ptrCast. This is an unsafe operation that Zig cannot protect you against."
This is also documented in the "Undefined Behavior" section.
@alignCast
Incorrect alignment is also documented in "Undefined Behavior" section.
@qualCast
Warning about unsafe behavior is missing.
Undefined behavior caused by @qualCast should probably be added to the "Undefined Behavior".
The text was updated successfully, but these errors were encountered:
Some builtin functions can cause undefined behavior or subvert the Zig type system.
I think these builtin functions should be clearly marked.
Here is a list, probably incomplete:
@addrSpaceCast
The documentation says that the operation may be illegal. What is the difference from undefined behavior?
There is no documentation in the "Undefined Behavior" section.
@ptrCast
The documentation says:
"Casting an optional pointer which is null to a non-optional pointer invokes safety-checked Undefined Behavior".
An additional warning is in the "volatile" section:
"To convert one pointer type to another, use
@ptrCast
. This is an unsafe operation that Zig cannot protect you against."This is also documented in the "Undefined Behavior" section.
@alignCast
Incorrect alignment is also documented in "Undefined Behavior" section.
@qualCast
Warning about unsafe behavior is missing.
Undefined behavior caused by
@qualCast
should probably be added to the "Undefined Behavior".The text was updated successfully, but these errors were encountered: