facebook / facebook/infer

Infer on glog library

Ouverte
#1,908 9 commentaires 0 réactions 1 personne assignée Réclamée par @davidpichardie Voir sur GitHub
pulse
Langage dominant
OCaml
Étoiles
15.7k
Forks
2.1k
Merge moyen
19 h 36 min
PR mergées (30 j)
13

Description

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;
}
```

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.