<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/57412>57412</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang][nullability] No warning when defererencing _Nullable pointers
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
iluuu1994
</td>
</tr>
</table>
<pre>
The [nullability documentation](https://clang.llvm.org/docs/analyzer/developer-docs/nullability.html) states:
> If a pointer p has a nullable annotation and no explicit null check or assert, we should warn in the following cases:
>
> * p gets implicitly converted into nonnull pointer, for example, we are passing it to a function that takes a nonnull parameter.
> * **p gets dereferenced**
However, I can't get Clang to warn for the latter case.
```c
#include <stdio.h>
int main() {
int * _Nullable x = NULL;
printf("%d", *x);
return 0;
}
```
> -Wnonnull -Wnull-dereference -Wnullability
https://godbolt.org/z/rrGW4h66T
Is there an undocumented flag that needs to be set? Or was this never fully implemented?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxtVFFzmzAM_jXw4gsHhhB44KFN1q13ve6luz3uDBbg1bE52zRpf_1kIA3pjTMYJEv6JH2i1vy9eumBBNt7NUrJaiGFeydcN-MRlGNOaBVsDwEteucGG6R3AX3A1UimukjKt2OkTYcCtLC4McXk-wcYL4E3kHoAs1l0qwBR744yoCWxGAImt_EhiC_P9Bt5bAkjgxbKgSED6ZnF79mDBMKU0jM4fOVEaQLnQYpGuOkMaXpoXok2hFkLxgV0T05AbK9HycmJGUWEIg7zbrWU-iRURxpm10AQwuqN3iGGDpwl4jjHke-k0eoNnQNHZ04jCDXFXkD7mC0igDNDE1ggMANkQFA-IoJFM0baUTVTKq5nKGKvMOV6cccMOwI6jG7x4I1rQcXBQIu3aoDPinU9f-gT9mJC9Ih5qoDunLcje99FD2IqiUfrayKZ80X3BYlu2pLH82qWb5oK1ciRI33SvXVc6KhHeGsbLAU5MoEhC9_uYHc_ywleXucz-fN8aesZHR3I86-npyBdHRwMHm0nFzSgWz5te297RqefR68GBtyICcVX1e7w30y-sm7z-1J2fMNtsyrsIloYvLa8HY1O81pLt8zFB97GfP-d9Xn-sjZ6tL7YxnOZjOoycEimVrJupoIC4Na3p0buggvSB_LTYK-8pbCoxqYieyRy0dMSZgd4LIQqyfMkL9M8KUJepbxMSxY6pC1UOOrT9Pqxvpl6FJDnmQuenqceFBLLZ-_z96JrpxaS23A0svqSv3D9WEeNPuKH_0Ms22Yw-i80OIwPwtoR_C9hu8sSGvZVkuRxXbK8hLTmRcIQe1vXRckoy-qkKUOMCtJ67IgyFBWNKY0LWiQpXrsI0ixrGZQ1K-KsbXmQxYC0k59_qNBUE4Z67CwqpbDOXpV-IDus9sU_G12vTSXkOI5JWWbhBLia0P4DSGGjRA">