[LLVMbugs] [Bug 15109] New: Add a new warning flag indicating floats implicitly being promoted to double (similar to gcc 4.8 -Wdouble-promotion)
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Tue Jan 29 09:51:04 PST 2013
http://llvm.org/bugs/show_bug.cgi?id=15109
Bug #: 15109
Summary: Add a new warning flag indicating floats implicitly
being promoted to double (similar to gcc 4.8
-Wdouble-promotion)
Product: clang
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: mm at celemony.com
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
GCC 4.8 has a -Wdouble-promotion warning flag. Description (via
http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html):
Give a warning when a value of type float is implicitly promoted to double.
CPUs with a 32-bit “single-precision” floating-point unit implement float in
hardware, but emulate double in software. On such a machine, doing computations
using double values is much more expensive because of the overhead required for
software emulation.
It is easy to accidentally do computations with double because floating-point
literals are implicitly of type double. For example, in:
float area(float radius)
{
return 3.14159 * radius * radius;
}
the compiler performs the entire computation with double because the
floating-point literal is a double.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list