public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* Invalid change of value conversion warning message
@ 2016-05-03  4:25 William Clodius
  0 siblings, 0 replies; 3+ messages in thread
From: William Clodius @ 2016-05-03  4:25 UTC (permalink / raw)
  To: fortran

The file

module test_int
  use, intrinsic:: iso_fortran_env

  integer(int64), parameter ::               &
      e18 = 1000000000000000000_int64,       &
      e19 = ( -huge(1_int64) +               &
              (e18-223372036854775807_int64) &
              ) - 2

end module test_int

when compiled using

fortran -std=f2008 -fmax-errors=10 -Wall -Wimplicit-interface -O3 -fbacktrace -fwhole-file -I mod_dir -c -o test_int.o test_int.f90 

on Mac OS X version 10.11.4

with version

gfortran --version
GNU Fortran (GCC) 6.1.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

produces the message

test_int.f90:5:11:

       e18 = 1000000000000000000_int64,       &
           1
Warning: Change of value in conversion from ‘INTEGER(8)’ to ‘REAL(4)’ at (1) [-Wconversion]

Putting in an 
implicit none
statement doesn’t change the message.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Invalid change of value conversion warning message
  2016-05-04 16:58 Dominique d'Humières
@ 2016-05-05  2:34 ` William Clodius
  0 siblings, 0 replies; 3+ messages in thread
From: William Clodius @ 2016-05-05  2:34 UTC (permalink / raw)
  To: fortran

Done. Entered as Invalid type determination due to expression in a type declaration statement
ID 70959

> On May 4, 2016, at 10:58 AM, Dominique d'Humières <dominiq@lps.ens.fr> wrote:
> 
> Simplified version
> 
> !  integer(8), parameter :: e18 = 10000000000_8
>  integer(8), parameter :: e18 = 100000000000_8
>  integer(8), parameter :: e19 = (e18)
> !  integer(8), parameter :: e19 = e18
> 
>  print *, e18, e19
> end
> 
> warn_conv_db_3.f90:2:32:
> 
>   integer(8), parameter :: e18 = 100000000000_8
>                                1
> Warning: Change of value in conversion from 'INTEGER(8)' to 'REAL(4)' at (1) [-Wconversion]
> 
> The warning is gone if I remove the parentheses in e19 = (e18) or if I replace 100000000000_8 with 10000000000_8.
> 
> Could you please file a buzilla report?
> 
> Dominique
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Invalid change of value conversion warning message
@ 2016-05-04 16:58 Dominique d'Humières
  2016-05-05  2:34 ` William Clodius
  0 siblings, 1 reply; 3+ messages in thread
From: Dominique d'Humières @ 2016-05-04 16:58 UTC (permalink / raw)
  To: williamclodius; +Cc: fortran

Simplified version

!  integer(8), parameter :: e18 = 10000000000_8
  integer(8), parameter :: e18 = 100000000000_8
  integer(8), parameter :: e19 = (e18)
!  integer(8), parameter :: e19 = e18

  print *, e18, e19
end

warn_conv_db_3.f90:2:32:

   integer(8), parameter :: e18 = 100000000000_8
                                1
Warning: Change of value in conversion from 'INTEGER(8)' to 'REAL(4)' at (1) [-Wconversion]

The warning is gone if I remove the parentheses in e19 = (e18) or if I replace 100000000000_8 with 10000000000_8.

Could you please file a buzilla report?

Dominique

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-05-05  2:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-03  4:25 Invalid change of value conversion warning message William Clodius
2016-05-04 16:58 Dominique d'Humières
2016-05-05  2:34 ` William Clodius

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).