This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/82018] [6/7/8 Regression] missing warnings with -Wconversion
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 29 Aug 2017 08:35:55 +0000
- Subject: [Bug fortran/82018] [6/7/8 Regression] missing warnings with -Wconversion
- Auto-submitted: auto-generated
- References: <bug-82018-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82018
--- Comment #2 from janus at gcc dot gnu.org ---
(In reply to janus from comment #0)
>
> i8 = 2.0
> 1
> Warning: Possible change of value in conversion from REAL(4) to INTEGER(8)
> at (1) [-Wconversion]
Note that if I change 2.0 to 2.1 here, I do get a warning also with gfortran 6.
It seems this was an intended change of behavior.
However I would argue that the warning was useful indeed. In a well-written
code one should write "i8 = 2" instead of "i8 = 2.0".
Maybe one could re-enable such warnings at least with -Wextra?