facebook / facebook/infer

UNITIALIZED_VALUE possible false positive

未关闭
#1,298 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
false-positive
主要语言
OCaml
星标
15.7k
派生
2.1k
平均合并
19 小时 36 分钟
30 天内合并 PR
13

描述

Please make sure your issue is not addressed in the [FAQ](https://fbinfer.com/docs/support#troubleshooting).

Please include the following information:
- [x] Infer version v0.17.0
- [x] Operating system CentOS Linux 7 (Core)
- [x] Which command you ran: `infer -- g++ test.cc`
- [x] [The full output in a paste](https://gist.github.com/diego200052/48d5c7c805d20fd2da762b769b87ba00).
- [x] If possible, a minimal example to reproduce your problem (for instance, some code where
infer reports incorrectly, together with the way you run infer to reproduce the incorrect
report).

```cc
#include

using namespace std;

void printNumber() {
int number1 __attribute__((unused)) = 1;
int number2 __attribute__((unused));
cout<<"Number: " << number1;
}

int main() {
cout<<"\nHello World!\n";
printNumber();
return 0;
}
```

It prints (probably wrongly) this error:
```
test.cc:8: error: UNINITIALIZED_VALUE
The value read from number1 was never initialized.
6. int number1 __attribute__((unused)) = 1;
7. int number2 __attribute__((unused));
8. > cout<<"Number: " << number1;
9. }
10.
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。