]> git.ipfire.org Git - thirdparty/gcc.git/commit
libgomp.texi (omp_interop_*): Add note about 5.2-to-6.0 incompatibility
authorTobias Burnus <tburnus@baylibre.com>
Wed, 4 Jun 2025 11:25:05 +0000 (13:25 +0200)
committerTobias Burnus <tburnus@baylibre.com>
Wed, 4 Jun 2025 11:25:05 +0000 (13:25 +0200)
commit0f56d67a498fb5f6223c36589bb1f5d7ae219e45
treee9c4d1dddfdb0ec2adc4a185067bf4290855e9bd
parentac0a04b7a254fb8e1d8d7088336bcb4375807b1e
libgomp.texi (omp_interop_*): Add note about 5.2-to-6.0 incompatibility

GCC uses the 6.0 types - which are unfortunately not quite compatible with
code expecting 5.1/5.2 data types.  Therefore, this commit adds a note to
hopefully reduce surprises. Namely:

For C/C++: while OpenMP 5.1 and 5.2 used 'int *ret_code', OpenMP 6.0 uses
'omp_interop_rc_t *ret_code' in omp_interop_{int,ptr,str} and 'int' instead
of 'omp_interop_rc_t ret_code' in omp_get_interop_rc_desc.

Neither C nor C++ like passing the wrong pointer type, albeit for C, GCC < 14
and clang only warn (gcc >= r14-6037-g9715c545d33b3a has an error) and
using -fpermissive turns it into a warning and -Wno-incompatible-pointer-types
silences it for C.

C++ also dislikes passing an int to an enum, albeit -fpermissive turns the
error into a warning with g++ (but not clang++). And, here, using an enum
on the caller side works with both int and enum on the callee side.

libgomp/ChangeLog:

* libgomp.texi (omp_interop_{int,ptr,str,rc_desc}): Add note about
the 'ret_code' type change in OpenMP 6.

Co-authored-by: Sandra Loosemore <sloosemore@baylibre.com>
libgomp/libgomp.texi