https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101953

M W <mlwmohawk at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|INVALID                     |---
             Status|RESOLVED                    |UNCONFIRMED

--- Comment #3 from M W <mlwmohawk at gmail dot com> ---
(In reply to Andreas Schwab from comment #2)
> -32000.0 is outside the range of uint32_t, thus the conversion is undefined.

I understand your response, but I disagree. Why is it different than x86_64? I
have been using gcc for literally decades and have NEVER seen this evaluation.
Why is it different from 9.3.0?

On CentOS 7, we get

[root@localhost ~]# gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[root@localhost ~]# ./badpi 
-32000 vs -32000


This is a bug that breaks real code. There is an extra step being taken on
raspberry pi that breaks existing code. 

If you think this is the correct behavior, remember, it is unexpected. At least
give a warning when a value is set to zero instead of a faithful attempt to
return the correct bits.

Reply via email to