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: "tkoenig at netcologne dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 29 Aug 2017 09:11:09 +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 #3 from tkoenig at netcologne dot de <tkoenig at netcologne dot de> ---
Am 29.08.2017 um 10:35 schrieb janus at gcc dot gnu.org:
> 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?
The warning is given with -Wconversion-extra.
We could enable -Wconversion-extra with -Wextra.