Fix #12921 New check: Detect floating-point casts that cause loss of precision#6583
Conversation
|
|
There should be existing compiler warnings for this (which we obviously have disabled because they are considered false positives or useless or whatever reason was given). |
|
At least clang-tidy and MSVC don't detect this. I have run the new check on a large-ish code base and found more than 30 instances already, no FPs. |
double f(double a, double b, float c) {
return a + (float)b + c;
}https://godbolt.org/z/edfMs737P Also see discussion in #4820 as to way the warning is not enabled in our code base yet. |
|
I see, didn't know about that compiler warning. However, |
|
See also llvm/llvm-project#93288. |



No description provided.