qcms has a bunch of code like: float p; ... p *= 65535.; Since the type of 65535. is a double this code will promote p to a double to do the multiply. This causes the, likely unintended, conversion to double and conversion back to float. It would be nice if we could warn about situations like this.
I am a student from SJCE, Mysore India and would like to take up this bug.
FWIW, GCC >= 4.6 already has an option to do this (-Wdouble-promotion). The implementation was straightforward; I don't think it would be too hard to port it to clang, if it's not already there.
Sounds like a good minor reason to bump gcc...if anyone feels bored :)
clang also supports the -Wdouble-promotion warning: > warning: implicit conversion increases floating-point precision: A to B https://clang.llvm.org/docs/DiagnosticsReference.html#wdouble-promotion
OS: Mac OS X → Unspecified
Hardware: x86 → Unspecified
P5 because this warning is very noisy and, AFAIU, is a performance problem, not a correctness bug.
Assignee: prarthanasjce → nobody
Priority: -- → P5
I don't think we will ever fix that, closing.
Severity: normal → enhancement
Status: NEW → RESOLVED
Last Resolved: 19 days ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.