Open vinc17fr opened 11 years ago
The most visible issue caused by this is apparently that using -fsanitize=undefined on programs that make use of floating point division by 0.0 (which is perfectly legal udner IEEE floats) will print "runtime error: division by zero".
(Also see: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=720935)
It's also scary to think that your program might run slightly incorrectly in corner cases under clang, while it's correct under gcc (at least with -std=c99, gcc intentionally breaks floating point semantics with -std=gnu99).
@llvm/issue-subscribers-c
Author: Vincent Lefèvre (vinc17fr)
Extended Description
clang should support Annex F of ISO C (IEC 60559 / IEEE 754), at least the basic features. Support could be controlled by options; for instance, it could be disabled by options like GCC's -ffast-math.
If clang intends to be a replacement for GCC (as its Wikipedia page says), this is really a must. GCC's IEEE 754 support is rather good, though not complete: http://gcc.gnu.org/wiki/FloatingPointMath
And clang should be at least as good as GCC. Currently clang doesn't even support basic features such as division by zero, which is regarded as undefined (as said in bug 17000).