search for: 8a9040de

Displaying 3 results from an estimated 3 matches for "8a9040de".

2018 Apr 05
0
double to unsigned char cast
Hi Jay, On 5 April 2018 at 07:49, Jay K via llvm-dev <llvm-dev at lists.llvm.org> wrote: > wrt > https://github.com/mono/mono/commit/fb91fce5d339bb9ffe507588f5bc1d8d6f244d9b > > > This doesn't seem right to me. Nevertheless, it's what the standard says. C99 6.3.1.4: When a finite value of real floating type is converted to an integer type other than _Bool, the
2018 Apr 05
2
double to unsigned char cast
wrt https://github.com/mono/mono/commit/fb91fce5d339bb9ffe507588f5bc1d8d6f244d9b This doesn't seem right to me. Both of these should have the and 0xff. $ cat /s/1.c unsigned char f1 (double i) { return (unsigned char)i; } unsigned char f2 (double i) { return (unsigned char)(int)i; } $ clang --version Apple LLVM version 9.0.0 (clang-900.0.39.2) Target:
2018 May 22
2
double to unsigned char cast
...e behavior is undefined. By definition any double you're allowed to convert to an unsigned char doesn't need the "and". Cheers. Tim. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180522/8a9040de/attachment.html>