authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-12-30 22:05:30-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-12-30 22:05:30-08:00
log6d67658965bc298a697dc756a4e06bda144427de
treecbfdcd1bd2bece92aa8737d79af691405c557aa2
parent021289a6531faaeee88e26a35412dbe54f6419e0

langref: move pointer casting section out of volatile subsection


1 files changed, 9 insertions(+), 8 deletions(-)

doc/langref.html.in+9-8
......@@ -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>