| ... | @@ -2026,9 +2026,9 @@ fn foo(bytes: []u8) u32 { | ... | @@ -2026,9 +2026,9 @@ fn foo(bytes: []u8) u32 { |
| 2026 | {#header_open|allowzero#} | 2026 | {#header_open|allowzero#} |
| 2027 | <p> | 2027 | <p> |
| 2028 | This pointer attribute allows a pointer to have address zero. This is only ever needed on the | 2028 | This pointer attribute allows a pointer to have address zero. This is only ever needed on the |
| 2029 | freestanding OS target, where the address zero is mappable. In this code example, if the pointer | 2029 | freestanding OS target, where the address zero is mappable. If you want to represent null pointers, use |
| 2030 | did not have the {#syntax#}allowzero{#endsyntax#} attribute, this would be a | 2030 | {#link|Optional Pointers#} instead. In this code example, if the pointer did not have the |
| 2031 | {#link|Pointer Cast Invalid Null#} panic: | 2031 | {#syntax#}allowzero{#endsyntax#} attribute, this would be a {#link|Pointer Cast Invalid Null#} panic: |
| 2032 | </p> | 2032 | </p> |
| 2033 | {#code_begin|test|allowzero#} | 2033 | {#code_begin|test|allowzero#} |
| 2034 | const std = @import("std"); | 2034 | const std = @import("std"); |