diff --git a/doc/langref.html.in b/doc/langref.html.in index f774c0bfdc..f3cb0fbae8 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -2788,9 +2788,11 @@ test "volatile" {
{#header_close#}- To convert one pointer type to another, use {#link|@ptrCast#}. This is an unsafe - operation that Zig cannot protect you against. Use {#syntax#}@ptrCast{#endsyntax#} only when other - conversions are not possible. + {#link|@ptrCast#} converts a pointer's element type to another. This + creates a new pointer that can cause undetectable illegal behavior + depending on the loads and stores that pass through it. Generally, other + kinds of type conversions are preferable to + {#syntax#}@ptrCast{#endsyntax#} if possible.
{#code_begin|test|test_pointer_casting#} const std = @import("std"); @@ -8592,7 +8594,8 @@ test "decl access by string" {{#syntax#}@floatFromInt(int: anytype) anytype{#endsyntax#}
Converts an integer to the closest floating point representation. The return type is the inferred result type. - To convert the other way, use {#link|@intFromFloat#}. This cast is always safe. + To convert the other way, use {#link|@intFromFloat#}. This operation is legal + for all values of all integer types.
{#header_close#}