The compiler certainly will not complain about this code as it is because its behaviour is dependent on its run time inputs. The int will be cast to double, multiplied with the other double, and result truncated to store in the qint64. If the range of the input values is known (checked) then there need not be any issue at all with this code. The compiler may warn if you try something like this:
which is detectable at compile time.
Bookmarks