BUG in definition for omp_test_nest_lock

I got an error while compiling

NVFORTRAN-S-0095-Expression has wrong data type (file:line)

for this statement:

out = omp_test_nest_lock (lock) .gt. 0

which I could not understand, since according to the OpenMP standard omp_test_nest_lock should return an integer.

Digging in to the files I see that in the interface file omp_lib.h the function is defined as

      function omp_test_nest_lock(nvar)                             &
 &    bind(c, name='omp_test_nest_lock_')
          import
          integer (kind=omp_nest_lock_kind), intent(inout) :: nvar
          logical (kind=omp_logical_kind) omp_test_nest_lock
      end function omp_test_nest_lock

but I believe it should be

      function omp_test_nest_lock(nvar)                             &
 &    bind(c, name='omp_test_nest_lock_')
          import
          integer (kind=omp_nest_lock_kind), intent(inout) :: nvar
          integer (kind=omp_integer_kind) omp_test_nest_lock
      end function omp_test_nest_lock

See the OpenMP standard: omp_test_lock and omp_test_nest_lock

I havde checked all the NVHPC compiler versions we have on the system: 21.5 21.7 22.5 23.5 24.1 24.5 and it is present in all of them

Thanks for the report haugboel. I confirmed with our OpenMP team that we should be using integer return type here so have filed a problem report, TPR ##35763.

Engineering let me know that they have updated omp_lib.h with this change in our 24.7 release.

Thanks for the update. Good to know!