[Flang-dev] gnu extensions/ workarounds in flang

Steve Kargl sgk at troutmask.apl.washington.edu
Thu Oct 18 11:04:22 EDT 2018


On Thu, Oct 18, 2018 at 03:36:42PM +0800, blubee blubeeme wrote:
> 
> double complex function besselh_p(n,xi,x)
>   implicit none
>   integer :: n
>   double precision :: x,xi
>   double complex, external :: besselh
> 
>   besselh_p = xi/2.d0*(besselh(n-1,2,x)-besselh(n+1,2,x))
> 

It seems that flang and/or f18 does not support the
common extension of "double complex".  Turning on
standard conformance with gfortran gives

gfcx -c -std=f95 a.f90
a.f90:1:15:

  double complex function besselh_p(n,xi,x)
               1
Error: GNU Extension: DOUBLE COMPLEX at (1)

So, you need to change the declaration to

 function besselh_p(n,xi,x)
   implicit none
   integer, parameter :: dknd = kind(1.d0)
   complex(kind=dknd) besselh_p
   integer :: n
   double precision :: x,xi
   complex(kind=dknd), external :: besselh


-- 
Steve



More information about the flang-dev mailing list