We're currently checking our code prior to upgrading from 220.127.116.11 to 18.104.22.168. Apart from syntax changes for subroutines with no arguments and bind(c) evrything seems to be okay. For example
subroutine mysub bind(c)
no longer compiles, instead we have
subroutine mysub() bind(c)
Yesterday we found that some functions that are C and used in the Fortran code through asssociated function pointers now need the bind(c) attribute. However it isn't true of all such functions. For example with the interface below
abstract interface subroutine updateloadsetvector(loadcaseid,berror,igid,dval) use iso_c_binding integer(c_int),value,intent(in) :: loadcaseid,igid logical*4,intent(out):: berror real(c_double),value,intent(in) :: dval end subroutine updateloadsetvector end interface
the arguments are not passed by value, whereas if bind(c) is added then the arguments are passed by value. But this isn't true of all such functions; with the interface below
abstract interface subroutine getdefaultgroup(key,igrflag,zcurgrp) use iso_c_binding integer(c_int), value, intent(in) :: key integer(c_int),intent(out):: igrflag(*) character*(*), intent(out):: zcurgrp end subroutine getdefaultgroup end interface
the bind(c) attribute is not needed in order to get pass-by-value. It is almost as if the value attribute is being ignored when there are no arrays or character strings in the argument list. I have tried at /assume:std_value but that has not effect in this case.
So although I've fixed the problem by adding a sprinkling of bind(c)s I'd like to understand the change - or report the new behaviour as a bug.