Hi,
During gcc bootstrap, there's a couple of places where the warning got
triggered.
I suppose this wasn't a false positive since enum gomp_schedule_type
and enum omp_sched_t
are different types (although they have same set of values) ?

Bootstrap+tested on x86_64-unknown-linux-gnu.
Is this patch OK to commit ?

Thanks,
Prathamesh
2017-05-02  Prathamesh Kulkarni  <prathamesh.kulka...@linaro.org>

        * icv.c (omp_set_schedule): Cast kind to enum gomp_schedule_type
        before assigning to icv->run_sched_var.
        (omp_get_schedule): Cast icv->run_sched_var to enum omp_sched_t before
        assigning it to *kind.

diff --git a/libgomp/icv.c b/libgomp/icv.c
index 233d6dbe10e..71e1f677fd7 100644
--- a/libgomp/icv.c
+++ b/libgomp/icv.c
@@ -87,14 +87,14 @@ omp_set_schedule (omp_sched_t kind, int chunk_size)
     default:
       return;
     }
-  icv->run_sched_var = kind;
+  icv->run_sched_var = (enum gomp_schedule_type) kind;
 }
 
 void
 omp_get_schedule (omp_sched_t *kind, int *chunk_size)
 {
   struct gomp_task_icv *icv = gomp_icv (false);
-  *kind = icv->run_sched_var;
+  *kind = (enum omp_sched_t) icv->run_sched_var;
   *chunk_size = icv->run_sched_chunk_size;
 }
 

Reply via email to