[LLVMbugs] [Bug 15199] Different type conversion in ternary operator between clang and gcc

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Feb 7 13:35:25 PST 2013


http://llvm.org/bugs/show_bug.cgi?id=15199

Richard Smith <richard-llvm at metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |richard-llvm at metafoo.co.uk
         Resolution|---                         |INVALID

--- Comment #4 from Richard Smith <richard-llvm at metafoo.co.uk> ---
The conversion from kint64max to double rounds up; the conversion from double
back to int64_t overflows. This program has undefined behavior.

$ clang yourcode.cpp -fsanitize=undefined
$ ./a.out
<unknown>: runtime error: value 9.22337e+18 is outside the range of
representable values of type 'long'

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130207/aaca98d6/attachment.html>


More information about the llvm-bugs mailing list