Silverfrost Forums

Welcome to our forums

Incorrect detection of Missing Optional argument

29 Jan 2022 1:41 #28725

When compiled with /checkmate turned on (version 8.80), the following code gives a run-time error. 'Reference through missing OPTIONAL argument'.

(It worked fine with 8.70)

However, the code is correct and works OK with NAG and gfortran compilers.

module mmm
contains
   subroutine xxx(m, a, b)
      integer m
      double precision, optional :: a(:), b(:)
      print *, m, a
   end subroutine

   subroutine yyy(m, a, b)
      integer m
      double precision, optional :: a(:), b(:)
      ! This call is valid even if a and/or b not provided
      call xxx(m, a, b)
   end subroutine

   subroutine caller(func)
      interface
         subroutine func(m, a, b)
            integer m
            double precision, optional :: a(:), b(:)
         end subroutine
      end interface
      call func(1, (/1.0d0, 1.0d0/))
   end subroutine
end module

program anon
use mmm
call caller(yyy)
end
30 Jan 2022 7:55 #28730

Thank you for the bug report which I have logged for investigation.

10 Feb 2022 10:28 #28767

This regression has now been fixed for the next release of FTN95.

Please login to reply.