[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 06:46:31 UTC 2018


Ping?

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


More information about the igt-dev mailing list