[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc
Subject:    Re: Warning for converting (possibly) negative float/double to unsigned int
From:       Andrew Haley <aph () redhat ! com>
Date:       2016-02-27 21:20:34
Message-ID: 56D21322.5010408 () redhat ! com
[Download RAW message or body]

On 27/02/16 11:53, Jakub Jelinek wrote:
> On Sat, Feb 27, 2016 at 10:39:59AM +0000, 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 this
>> conversion as a GCC extension and implement it consistently
>> everywhere.  Then we wouldn't need a warning, and there'd be
>> one fewer trap.
> 
> I disagree.  That would slow down most of uses that use it when they know
> the floating point value must be non-negative, for the benefit
> of the few that invoke implementation defined behavior.

Would it really slow things down significantly?  If so, perhaps I
can see the point of this restriction.

Andrew.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic