Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all articles
Browse latest Browse all 5691

Array Initialization Error when mixing different integer types.

$
0
0

Code:

PROGRAM main

  USE ISO_C_BINDING
 
  IMPLICIT NONE
  INTEGER, PARAMETER :: DIM0 = 7
  INTEGER, PARAMETER :: DIM1 = 4
  INTEGER, PARAMETER :: num_flags = 4
  INTEGER(kind=8), PARAMETER :: DIM0a = 7
  INTEGER(kind=8), PARAMETER :: DIM1a = 4
 
  INTEGER, DIMENSION(1:3) :: dim_qf_data =(/DIM0,4,num_flags/)
  INTEGER(kind=8), DIMENSION(1:2) :: dims = (/DIM0a,DIM1a/) ! #1
  INTEGER(kind=8), DIMENSION(1:2) :: dims = (/DIM0,DIM1/) ! #2

  print*,dim_qf_data
   print*,dims
END PROGRAM main

When I use #1 it prints correctly:

7,4,4

7,4

 

But when I use #2 it prints dim_qf_data's second array value wrong:

7,0,4

7,4

 

For Intel 14.0 it was correct for both. It also works correctly on Mac and Linux with Intel 15.0 (and 14.0).

 

Computer system env. attached.
 

 

 

 

 


Viewing all articles
Browse latest Browse all 5691

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>