This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/47659] -Wconversion[-extra] should emit warning for constant expressions
- From: "sgk at troutmask dot apl.washington.edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 8 Aug 2011 14:51:03 +0000
- Subject: [Bug fortran/47659] -Wconversion[-extra] should emit warning for constant expressions
- Auto-submitted: auto-generated
- References: <bug-47659-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47659
--- Comment #5 from Steve Kargl <sgk at troutmask dot apl.washington.edu> 2011-08-08 14:50:33 UTC ---
On Mon, Aug 08, 2011 at 06:07:36AM +0000, thenlich at users dot sourceforge.net
wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47659
>
> --- Comment #4 from Thomas Henlich <thenlich at users dot sourceforge.net> 2011-08-08 06:07:33 UTC ---
> It is not safe to omit the warning for integers: the constant could have been
> truncated to an integer, as in:
>
> real(8) :: r8
> r8 = 12345678.9
> print *, r8
>
> => 12345679.0000000
Technically, the above is not a truncation to integer. The
rhs is rounded.