[igt-dev] [PATCH i-g-t 1/4] tests/sw_sync: fix pthread start_routine declaration

Petri Latvala petri.latvala at intel.com
Tue Jun 19 07:37:41 UTC 2018


On Mon, Jun 18, 2018 at 11:46:31PM -0700, Lucas De Marchi wrote:
> Ping?

A tentative

Reviewed-by: Petri Latvala <petri.latvala at intel.com>

on the series.

What is the practical effect of -std=gnu11 in terms of gcc version
requirement? I know using C++11 requires some creative selection of
gcc versions, but I have no idea about C11.



-- 
Petri Latvala



> 
> Lucas De Marchi
> On Wed, Jun 6, 2018 at 3:31 PM Lucas De Marchi <lucas.demarchi at intel.com> wrote:
> >
> > pthread_create() expects a void *(*start_routine) (void *). Fix warning
> > the following warning on gcc 8:
> >
> > ../tests/sw_sync.c:773:37: warning: cast between incompatible function types from ‘int (*)(void *)’ to ‘void * (*)(void *)’ [-Wcast-function-type]
> >    pthread_create(&threads[i], NULL, (void * (*)(void *))
> >                                      ^
> > Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
> > ---
> >  tests/sw_sync.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/tests/sw_sync.c b/tests/sw_sync.c
> > index 20dfbbb9..afe58b0c 100644
> > --- a/tests/sw_sync.c
> > +++ b/tests/sw_sync.c
> > @@ -669,7 +669,7 @@ static struct {
> >         pthread_mutex_t lock;
> >  } test_mpsc_data;
> >
> > -static int mpsc_producer_thread(void *d)
> > +static void *mpsc_producer_thread(void *d)
> >  {
> >         int id = (long)d;
> >         int fence, i;
> > @@ -702,7 +702,7 @@ static int mpsc_producer_thread(void *d)
> >                 close(fence);
> >         }
> >
> > -       return 0;
> > +       return NULL;
> >  }
> >
> >  static int mpsc_consumer_thread(void)
> > --
> > 2.17.1
> >
> > _______________________________________________
> > igt-dev mailing list
> > igt-dev at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/igt-dev
> 
> 
> 
> -- 
> Lucas De Marchi
> _______________________________________________
> igt-dev mailing list
> igt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev


More information about the igt-dev mailing list