-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enabled and fixed -Wdouble-promotion
Clang warnings
#7164
base: main
Are you sure you want to change the base?
Conversation
Clang/GCC doesn't implement their checkers properly... Code 1:
Clang says:
Code 2:
.. after some time you have this .. Code 3:
And the compilers are silent about this. By turning on |
In that case please file an upstream report. Looks like this might also be related to llvm/llvm-project#93288. |
Nah, I doubt they would care about it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reject this because it can lead to performance and readability issues in the long run.
@@ -824,7 +824,7 @@ static std::unordered_map<std::string, BuiltinLibraryFunction> createBuiltinLibr | |||
return ValueFlow::Value::unknown(); | |||
ValueFlow::Value v; | |||
combineValueProperties(args[0], args[1], v); | |||
v.floatValue = std::nexttoward(asFloat(args[0]), asFloat(args[1])); | |||
v.floatValue = std::nexttoward(asFloat(args[0]), static_cast<long double>(asFloat(args[1]))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this "fix" the issue.. there is still the promotion that clang warned about. This code will work technically exactly the same as before as far as I see.
Great attitude. Imagine people had the attitude towards false positives in Cppcheck. Well, you might not imagine. They have that 100%. They just suppress the FP and if at some point there are too many suppressions or it gets too slow they just completely drop it completely because it "offers no value". That's how any tooling (not just open source) starts to deteriorate (even in cases where the devs actually care about the application and bug reports). Well, they basically were too lazy to file a report and found me as the idiot which did their work for them because I cared. That is actually the scenario because I got involved again because I wanted it to improve, so other people see that it actually has value and should be kept. See where that got me ... And there has also been cases where people (including me) made something out to be a "false positive" but it turned out it was not and at the end you actually learned something new.... |
Yes I have seen it myself also. |
No description provided.