On 6/2/25 12:15, Tobias Burnus wrote:
Not really new - but as the topic came up elsewhere (OpenMP issue 4455),
I had a second thought about this and I think it make sense to add a note.

GCC uses the OpenMP 6.0 version.

The problem is that 'int'/'int*' became 'omp_interop_rc_t ret_code'
and 'omp_interop_rc_t *ret_code'.

For C++, passing the wrong pointer type type give an error and
also passing 'int' to 'enum' gives an error (but -fpermissive turns
that one into a warning in g++ but not in clang++).

For C, gcc < 14 and clang print a -Wincompatible-pointer-types warning
by default for the pointer-type mismatch; gcc >= 14 has an error by default: r14-6037-g9715c545d33b3a  c: Turn -Wincompatible-pointer-types into a permerror

[For the non-pointer issue, the solution is just to use the enum,
for the pointer issue there is no real solution in C++ and only an
ugly for C.]

See also https://gcc.gnu.org/onlinedocs/libgomp/Interoperability-Routines.html

Comments, suggestions, remarks before I commit it?

I think the patch just confuses readers, as-is. Plus it has a grammar bug. How about instead of

+Note that OpenMP prior to 6.0 use the type @code{int} for @var{ret_code}
+in C/C++.

we say something like

Libgomp implements the OpenMP 6.0 version of this function for C and C++, which is not compatible with its type signature in previous versions of the OpenMP specification. In older versions, the type @code{int} was used in place of the enumerated type @code{omp_interop_rc_t}.

-Sandra


Reply via email to