mirror of
https://github.com/github/codeql.git
synced 2026-05-04 13:15:21 +02:00
Merge pull request #5859 from MathiasVP/fix-fp-in-comparison-with-wider-type
C++: Fix false positive in `cpp/comparison-with-wider-type`
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
void test_issue_5850(unsigned char small, unsigned int large1) {
|
||||
for(; small < static_cast<unsigned char>(large1 - 1); small++) { } // GOOD
|
||||
}
|
||||
|
||||
void test_widening(unsigned char small, char large) {
|
||||
for(; small < static_cast<unsigned int>(static_cast<short>(large) - 1); small++) { } // GOOD
|
||||
}
|
||||
Reference in New Issue
Block a user