facebook / facebook/infer

Infer on glog library

Aperta
#1,908 9 commenti 0 reazioni 1 assegnatario Rivendicata da @davidpichardie Vedi su GitHub
pulse
Lingua principale
OCaml
Stelle
15.7k
Fork
2.1k
Merge medio
19h 36m
PR unite (30g)
13

Descrizione

Hello everybody,

I am playing with Infer (commit May 14th 2025 #5e8c9) running on Ubuntu 20.04 and analyzing a medium/big size cpp project.

I am running the pulse checker, and inspecting all the null pointer violations.

I noticed many false positive caused by the use in my code of the **glog logging** library.

Below I isolated a tiny cpp program triggering a **null reference** false positive alarm when printing with std::cout.

-- Is it possible to instruct the analyzer about the behavior of the glog library?

I tried _pulse-model-return-nonnull-list_ and _pulse-model-abort_ but I suspect the problem is more complex than that.

Please any advice is very appreciated. Thank you.

```
#include
#include
int infer(int c) {
int a = 10;
int* p = nullptr;
if (c > 0) {
p = &a;
}
CHECK(p!=NULL);
std::cout << *p << std::endl;
return 0;
}
```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.