-fsanitize=nullability should trigger on uninitialized pointers
Open
compiler-rt:ubsan
undefined behaviour
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
https://godbolt.org/z/Mfn8f4vYb
```
#include
#include
int main() {
void* a = nullptr;
void* _Nonnull b;
void* _Nonnull c = nullptr; // Only this one is triggered
void* _Nonnull d = &c;
memset(&d, 0, sizeof(d));
fprintf(stderr, "Done");
return 0;
}
```
I can see that memset case can be hard, but uninitialized value with or without -ftrivial-auto-var-init=zero should be easy.
Contributor guide
Assessment
This issue has not been assessed yet.