https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90536

--- Comment #11 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Mon, May 20, 2019 at 07:32:09AM +0000, tkoenig at gcc dot gnu.org wrote:
> 
> what I meant is that
> 
> Program main
>   Integer(kind=1) :: n
>   n = 1
> End
> 
> should not warn with -fno-range-check -Wall, and it does.
> 

The warning technically is correct.  It is a warning about the
type conversion not about the value.

d.f90:3:6:

    3 |   n = 1
      |      1
Warning: Conversion from 'INTEGER(4)' to 'INTEGER(1)' at (1) [-Wconversion]

Here '1' is INTEGER(4).  The assignment converts it to INTEGER(1).
Hence, a warning is issued.  Preventing range checking causes
one to take a different path through the compiler.  If -Wconversion
is active, then you shockingly might get a warning.  If a user
doesn't want to see warnings, don't ask for them!  In fact, one
might argument that if a warning isn't issued with either -Wconversion
or especially -Wconversion-extra, then these options are broken. 

Personally, I think this PR is much ado about nothing as one
can simply add -Wno-conversion to the options to suppress a
valid warning.  I closed the PR.  It has now been re-opened,
but mysteriously it has not be assigned.

Reply via email to