We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a806a4f commit 8933bbdCopy full SHA for 8933bbd
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 k = static_cast<long>(i * i); //Correct: modern C++
0 commit comments