This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/28038] Double to char conversion fails at 32769.0
- From: "schwab at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Jun 2006 16:04:08 -0000
- Subject: [Bug c/28038] Double to char conversion fails at 32769.0
- References: <bug-28038-12832@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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