zero_ptr
Finds cast(*T) 0, which is null.
Category style, warn by default.
#import "Basic";
main :: () {
p := cast(*u8) 0;
print("%\n", p);
}warning[zero_ptr]: `cast(*u8) 0` is a null pointer
--> example.jai:4:10
|
4 | p := cast(*u8) 0;
| ^^^^^^^^^^^
|
help: write `null`
|
4 ~ p := null;
|
= note: `zero_ptr` is `warn` by default#import "Basic";
main :: () {
p: *u8 = null;
print("%\n", p);
}Only cast(*T) 0 (also 0x0) without cast modifiers.