This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/23572] No warning for assigning a value to a 'float' variable that overflows with option -Wextra
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Aug 2005 03:10:01 -0000
- Subject: [Bug other/23572] No warning for assigning a value to a 'float' variable that overflows with option -Wextra
- References: <20050826075201.23572.qiyaoltc@cn.ibm.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-08-29 03:10 -------
I think there are some real interesting issues here.
First with -pedantic we get a warning for line 9 but nothing more. If we add f to the end of the
constant on line 5, we then get a warning.
And yes your example was useful.
The interesting thing is that we don't get a warning for the following code:
double d1 = 1.9E+308 + 1.;
which should warn.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |diagnostic
Known to work| |2.95.3 3.2.3 3.4.0 4.0.0
| |4.1.0
Last reconfirmed|0000-00-00 00:00:00 |2005-08-29 03:10:00
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23572