diff mbox series

[2/2] PR 78736: libgomp fallout

Message ID CAAgBjM=P4mwfgm_x5fqPmQv+abLtTp_hFSRDPpV80R6pUjmi0A@mail.gmail.com
State New
Headers show
Series None | expand

Commit Message

Prathamesh Kulkarni May 2, 2017, 5:13 p.m. UTC
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.kulkarni@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.

Comments

Prathamesh Kulkarni May 9, 2017, 1:25 p.m. UTC | #1
ping https://gcc.gnu.org/ml/gcc-patches/2017-05/msg00135.html

Thanks,
Prathamesh

On 2 May 2017 at 22:43, Prathamesh Kulkarni
<prathamesh.kulkarni@linaro.org> wrote:
> 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
Jakub Jelinek May 9, 2017, 1:29 p.m. UTC | #2
On Tue, May 09, 2017 at 06:55:12PM +0530, Prathamesh Kulkarni wrote:
> ping https://gcc.gnu.org/ml/gcc-patches/2017-05/msg00135.html


The libgomp patch is ok provided the warning is added.
Though, should it be in -Wall and not say just -Wextra?

	Jakub
Prathamesh Kulkarni Sept. 4, 2019, 4:38 p.m. UTC | #3
On Tue, 9 May 2017 at 18:59, Jakub Jelinek <jakub@redhat.com> wrote:
>

> On Tue, May 09, 2017 at 06:55:12PM +0530, Prathamesh Kulkarni wrote:

> > ping https://gcc.gnu.org/ml/gcc-patches/2017-05/msg00135.html

>

> The libgomp patch is ok provided the warning is added.

> Though, should it be in -Wall and not say just -Wextra?

Hi Jakub,
I committed the patch for PR78736 to add warning under Wextra, so the
above warnings
for icv.c don't trigger during the build, and the patch isn't strictly
necessary.
Is it OK to commit the patch or leave as-is ?

Thanks,
Prathamesh
>

>         Jakub
Jakub Jelinek Sept. 4, 2019, 4:41 p.m. UTC | #4
On Wed, Sep 04, 2019 at 10:08:38PM +0530, Prathamesh Kulkarni wrote:
> On Tue, 9 May 2017 at 18:59, Jakub Jelinek <jakub@redhat.com> wrote:

> >

> > On Tue, May 09, 2017 at 06:55:12PM +0530, Prathamesh Kulkarni wrote:

> > > ping https://gcc.gnu.org/ml/gcc-patches/2017-05/msg00135.html

> >

> > The libgomp patch is ok provided the warning is added.

> > Though, should it be in -Wall and not say just -Wextra?

> Hi Jakub,

> I committed the patch for PR78736 to add warning under Wextra, so the

> above warnings

> for icv.c don't trigger during the build, and the patch isn't strictly

> necessary.

> Is it OK to commit the patch or leave as-is ?


I'd leave as is.

	Jakub
diff mbox series

Patch

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;
 }