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

Lucas De Marchi lucas.de.marchi at gmail.com
Tue Jun 19 20:30:27 UTC 2018


On Tue, Jun 19, 2018 at 12:37 AM Petri Latvala <petri.latvala at intel.com> wrote:
>
> 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.

I use it since forever in kmod, but there I have some
cruft^Wcompatibility macros. I can bring it over to igt if it's
needed, but I think it would be better to have a tentative push
without them.

Answering your question, according to
https://gcc.gnu.org/wiki/C11Status _Static_assert() that I'm using in
this series is available since gcc 4.6. Some C11 features entered in
4.7 and in 4.9 it was "feature complete".

Lucas De Marchi

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



-- 
Lucas De Marchi


More information about the igt-dev mailing list