This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/28038] Double to char conversion fails at 32769.0



------- Comment #3 from schwab at suse dot de  2006-06-15 16:04 -------
It is still undefined to convert a float to an integer that is too narrow.  The
range of short is irrelevant when converting to char.  Since the behaviour is
undefined there is no requirement on the resulting value.  If you want defined
behaviour you must first cast to an integer that is wide enough, then you can
cast to the narrower (unsigned) type.


-- 

schwab at suse dot de changed:

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


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28038


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]