We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4c5ecb4 + aa578ed commit a426412Copy full SHA for a426412
cpp/ql/src/Likely Bugs/Arithmetic/IntMultToLong.cpp
@@ -4,3 +4,5 @@ long j = i * i; //Wrong: due to overflow on the multiplication between ints,
4
5
long k = (long) i * i; //Correct: the multiplication is done on longs instead of ints,
6
//and will not overflow
7
+
8
+long l = static_cast<long>(i) * i; //Correct: modern C++
0 commit comments