Bad expression in constant kind parameter when using kinds from iso_fortran_env

2 views
Skip to first unread message

Andrew Porter

unread,
Dec 21, 2017, 5:43:25 AM12/21/17
to omni-compiler

Hello,

I'm attempting to use xmpf90 to compile the following code:

    module constants_mod

      use, intrinsic :: iso_fortran_env, only : real32, real64, int32

      implicit none

      integer, parameter :: r_def     = real64

      real(kind=r_def), parameter :: EPS = 3.0e-15_r_def

    end module

but the compiler gives:

[code_fragments]$ xmpf90 -c minimal_constants_mod.f90
"minimal_constants_mod.f90:constants_mod", line 9: bad expression in constant kind parameter
"minimal_constants_mod.f90:constants_mod", line 9: bad expression in constant kind parameter

If I change the definition of "r_def" from "real64" to e.g. KIND(1.0d0) then the compiler is happy.
Is this a known bug or something I'm doing wrong?

Many thanks,

Andy.

Andrew Porter

unread,
Dec 21, 2017, 5:44:05 AM12/21/17
to omni-compiler
I forgot to say that this is with the HEAD of the master branch.
Message has been deleted

Valentin Clément

unread,
Dec 21, 2017, 6:14:23 AM12/21/17
to omni-compiler
That sould be solved with the PR 180 https://github.com/omni-compiler/omni-compiler/pull/180

Andrew Porter

unread,
Dec 21, 2017, 9:12:46 AM12/21/17
to omni-compiler
Oh good - that will be useful.
Reply all
Reply to author
Forward
0 new messages