mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
langref: undefined _is_ materialized in all safe modes (#24107)
* trailing whitespace * langref: undefined _is_ materialized in all safe modes I am also not super happy about the clause that immediately follows. I _believe_ what we want to say here is that, simultaneously: * undefined is guaranteed to be matrerialized in in all safe modes. A Zig implementation that elides `ptr.* = undefined` in ReleaseSafe mode would be a non-conforming implementation. * A Zig program that relies on undefined being materialized is buggy. But I don't think it's the time to engage this level of language-lawering!
This commit is contained in:
parent
aa65fd5d7c
commit
173bc42744
1 changed files with 2 additions and 2 deletions
|
|
@ -777,7 +777,7 @@
|
||||||
value. Using this value would be a bug. The value will be unused, or overwritten before being used."
|
value. Using this value would be a bug. The value will be unused, or overwritten before being used."
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
In {#link|Debug#} mode, Zig writes {#syntax#}0xaa{#endsyntax#} bytes to undefined memory. This is to catch
|
In {#link|Debug#} and {#link|ReleaseSafe#} mode, Zig writes {#syntax#}0xaa{#endsyntax#} bytes to undefined memory. This is to catch
|
||||||
bugs early, and to help detect use of undefined memory in a debugger. However, this behavior is only an
|
bugs early, and to help detect use of undefined memory in a debugger. However, this behavior is only an
|
||||||
implementation feature, not a language semantic, so it is not guaranteed to be observable to code.
|
implementation feature, not a language semantic, so it is not guaranteed to be observable to code.
|
||||||
</p>
|
</p>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue