UNINITIALIZED_VALUE - false positive C
オープン
c
false-positive
- 主要言語
- OCaml
- スター
- 15.7k
- フォーク
- 2.1k
- 平均マージ
- 19時間 36分
- マージ済み PR(30日)
- 13
説明
In the following minimal example, the `var` variable is initialized into a `while(true)`, however, Infer reports an UNINITIALIZED_VALUE. I checked this case with `if (true)`, `for ( ; ; )` and `while(1)` and Infer returns the same error.
```
int main(){
int var;
while(true){
var = 0;
if(var==0) break;
}
printf("Var:%d\n",var);
return 0;
}
```
This is the Infer's report:
```
Found 1 issue
while_true.c:12: error: UNINITIALIZED_VALUE
The value read from var was never initialized.
10. if(var==0) break;
11. }
12. > printf("Var:%d\n",var);
13. return 0;
14. }
Summary of the reports
UNINITIALIZED_VALUE: 1
```
コントリビューションガイド
評価
この issue はまだ評価されていません。