[Openmp-commits] [openmp] [OpenMP][Flang]Fix omp_get_cancellation return type from integer to logical (PR #142990)

Eugene Epshteyn via Openmp-commits openmp-commits at lists.llvm.org
Tue Jun 10 05:52:30 PDT 2025


eugeneepshteyn wrote:

> The C implementation returns int. I haven't had time to check myself, but do we know that the C return value is correctly translated into LOGICAL?

Very good point. Luckily, OpenMP runtime uses `0` for FALSE and `!0` for TRUE, and flang (like gfortran) uses `0` for `.FALSE.` and `1` for `.TRUE.`, so I think it's compatible. If flang used `-1` for `.TRUE.`, then we would have a problem.

https://github.com/llvm/llvm-project/pull/142990


More information about the Openmp-commits mailing list