Skip to content

Commit 6d67658

Browse files
committed
langref: move pointer casting section out of volatile subsection
1 parent 021289a commit 6d67658

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

doc/langref.html.in

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2001,6 +2001,15 @@ or
20012001
the pointer is never dereferenced:</p>
20022002
{#code|test_comptime_pointer_conversion.zig#}
20032003

2004+
<p>
2005+
{#link|@ptrCast#} converts a pointer's element type to another. This
2006+
creates a new pointer that can cause undetectable illegal behavior
2007+
depending on the loads and stores that pass through it. Generally, other
2008+
kinds of type conversions are preferable to
2009+
{#syntax#}@ptrCast{#endsyntax#} if possible.
2010+
</p>
2011+
{#code|test_pointer_casting.zig#}
2012+
20042013
{#see_also|Optional Pointers|@ptrFromInt|@intFromPtr|C Pointers#}
20052014
{#header_open|volatile#}
20062015
<p>Loads and stores are assumed to not have side effects. If a given load or store
@@ -2015,14 +2024,6 @@ or
20152024
Input/Output, it is probably a bug.
20162025
</p>
20172026
{#header_close#}
2018-
<p>
2019-
{#link|@ptrCast#} converts a pointer's element type to another. This
2020-
creates a new pointer that can cause undetectable illegal behavior
2021-
depending on the loads and stores that pass through it. Generally, other
2022-
kinds of type conversions are preferable to
2023-
{#syntax#}@ptrCast{#endsyntax#} if possible.
2024-
</p>
2025-
{#code|test_pointer_casting.zig#}
20262027

20272028
{#header_open|Alignment#}
20282029
<p>

0 commit comments

Comments
 (0)