github / github/codeql

LGTM.com - false positive - missed conditional increment of a variable

Đang mở
#3,791 1 bình luận 0 reaction 1 người được giao Được @jbj nhận Xem trên GitHub
C++ false-positive
Ngôn ngữ chính
CodeQL
Star
10.1k
Fork
2.1k
Merge trung bình
2 ngày 15 giờ
Pull request đã merge (30 ngày)
141

Mô tả

**Description of the false positive**
I keep getting a "Comparison is always false because dif_steering <= 0." error on https://lgtm.com/projects/g/CleverRaven/Cataclysm-DDA/rev/pr-f7153dbafa3dbb084b7793d0d2ac10ebda2bca84

in https://lgtm.com/projects/g/CleverRaven/Cataclysm-DDA/snapshot/912bd27fe5b356ed2a34f3ce5b19e63ad5c9c4cd/files/src/veh_interact.cpp?sort=name&dir=ASC&mode=heatmap#L737, it's clear that dif_steering can be incremented to be more than 5, so this result is in error.

Also, I didn't actually change this part of the file, so I even if there was a false positive, I shouldn't be getting warned about it for this particular PR.

**https://lgtm.com/projects/g/CleverRaven/Cataclysm-DDA/rev/pr-f7153dbafa3dbb084b7793d0d2ac10ebda2bca84
**

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.