From 6d67658965bc298a697dc756a4e06bda144427de Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 30 Dec 2024 22:05:30 -0800 Subject: langref: move pointer casting section out of volatile subsection --- doc/langref.html.in | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'doc') diff --git a/doc/langref.html.in b/doc/langref.html.in index 87d73c987c..51f78e1be0 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -2001,6 +2001,15 @@ or the pointer is never dereferenced:

{#code|test_comptime_pointer_conversion.zig#} +

+ {#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|test_pointer_casting.zig#} + {#see_also|Optional Pointers|@ptrFromInt|@intFromPtr|C Pointers#} {#header_open|volatile#}

Loads and stores are assumed to not have side effects. If a given load or store @@ -2015,14 +2024,6 @@ or Input/Output, it is probably a bug.

{#header_close#} -

- {#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|test_pointer_casting.zig#} {#header_open|Alignment#}

-- cgit v1.2.3