On Tue, Oct 13, 2020 at 07:05:10PM +0100, Kwok Cheung Yeung wrote:
> --- a/libgomp/env.c
> +++ b/libgomp/env.c
> @@ -73,7 +73,8 @@ struct gomp_task_icv gomp_global_icv = {
>    .target_data = NULL
>  };
>  
> -unsigned long gomp_max_active_levels_var = INT_MAX;
> +const unsigned long gomp_supported_active_levels = INT_MAX;
> +unsigned long gomp_max_active_levels_var = gomp_supported_active_levels;

This is not valid C, and while gcc currently in GNU mode accepts it (I think
with optimization only?), we shouldn't use that.
It is valid C++ though.

I'd suggest to
#define gomp_supported_active_levels INT_MAX
in libgomp.h and leave out the const variable.  Another possibility is an
enumerator, but we don't include limits.h in libgomp.h.

> --- a/libgomp/libgomp.map
> +++ b/libgomp/libgomp.map
> @@ -172,6 +172,8 @@ OMP_5.0 {
>       omp_display_affinity_;
>       omp_get_affinity_format;
>       omp_get_affinity_format_;
> +     omp_get_supported_active_levels;
> +     omp_get_supported_active_levels_;

OMP_5.0 symbol version has been shipped already in GCC 9.  So we should
never add any further symbols to it.
Thus it needs to be added to OMP_5.0.1 symbol version instead (which is new
in GCC 11).

Otherwise LGTM.

        Jakub

Reply via email to