Quantcast
Channel: Intel® Fortran Compiler for Linux* and macOS*
Viewing all articles
Browse latest Browse all 2583

Precision and Enumerators

$
0
0
program test

  integer :: i

  enum, bind (c)
    enumerator :: enum
  end enum

  print*, KIND(i), KIND(enum)

end program test

 

When compiled with ifort (IFORT) 15.0.3 20150407 and -i8 option, the kind of the enumerator does not match the kind of the default integer (4 vs. 8).  Shouldn't the enumerator also be of kind 8?  I have not tried compiling with the latest ifort.  Also, I tried the following but it threw compiler errors.

program test

  integer :: i

  enum (kind=8), bind (c)
    enumerator :: enum
  end enum

  print*, KIND(i), KIND(enum)

end program test

 


Viewing all articles
Browse latest Browse all 2583

Trending Articles