Re: Warning for converting (possibly) negative float/double to unsigned int

2016-02-27 Thread Andrew Haley
On 27/02/16 11:53, Jakub Jelinek wrote: > On Sat, Feb 27, 2016 at 10:39:59AM +, Andrew Haley wrote: >> On 26/02/16 21:28, Bradley Lucier wrote: >>> Any advice on how to proceed? I'd be willing to write and test the few >>> lines of code myself if I knew where to put them. >> >> The best

Re: Warning for converting (possibly) negative float/double to unsigned int

2016-02-27 Thread Manuel López-Ibáñez
On 02/26/2016 09:28 PM, Bradley Lucier wrote: Perhaps this question is appropriate for the gcc mail list. Converting a float/double to unsigned int is undefined if the result would be negative when converted to a signed int. x86-64 and arm treat this condition differently---x86-64 returns a

Re: Warning for converting (possibly) negative float/double to unsigned int

2016-02-27 Thread Jakub Jelinek
On Sat, Feb 27, 2016 at 10:39:59AM +, Andrew Haley wrote: > On 26/02/16 21:28, Bradley Lucier wrote: > > Any advice on how to proceed? I'd be willing to write and test the few > > lines of code myself if I knew where to put them. > > The best thing, rather than warning, would be to define

Re: Warning for converting (possibly) negative float/double to unsigned int

2016-02-27 Thread Andrew Haley
On 26/02/16 21:28, Bradley Lucier wrote: > Any advice on how to proceed? I'd be willing to write and test the few > lines of code myself if I knew where to put them. The best thing, rather than warning, would be to define this conversion as a GCC extension and implement it consistently

Warning for converting (possibly) negative float/double to unsigned int

2016-02-26 Thread Bradley Lucier
Perhaps this question is appropriate for the gcc mail list. Converting a float/double to unsigned int is undefined if the result would be negative when converted to a signed int. x86-64 and arm treat this condition differently---x86-64 returns a value whose bit pattern is the same as the bit