mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
@@ -4,3 +4,5 @@ long j = i * i; //Wrong: due to overflow on the multiplication between ints,
|
||||
|
||||
long k = (long) i * i; //Correct: the multiplication is done on longs instead of ints,
|
||||
//and will not overflow
|
||||
|
||||
long l = static_cast<long>(i) * i; //Correct: modern C++
|
||||
|
||||
Reference in New Issue
Block a user