Meg's Mirrors
zig
about
heads
tags
log
tree
search
Search
zig
test
cases
compile_errors
compile_time_undef_ptr_cast.zig
pretty
plain
permalink
blame
history
•
10 lines
•
208 B
1
comptime {
2
var undef_ptr: *i32 = undefined;
3
const ptr: *i32 = @ptrCast(undef_ptr);
4
_ = &undef_ptr;
5
_ = ptr;
6
}
7
8
// error
9
//
10
// :3:32: error: use of undefined value here causes illegal behavior