[dpdk-dev] [PATCH] examples: fix typdef in performance thread app

Hunt, David david.hunt at intel.com
Mon May 14 12:01:16 CEST 2018


Hi Thomas,

On 13/5/2018 10:37 PM, Thomas Monjalon wrote:
> 10/05/2018 07:31, David Hunt:
>> The function pthread_create() expects void *(*func) (void *)
>> for function pointer, however, lthread_func_t was defined as
>> void (*func) (void *), so now gcc 8.1 warns that the cast is
>> incorrect, causing a compilation failure. This patch changes
>> the declaration of lthread_func_t from returning a void to
>> returning a void*, and then changes the sample app in the
>> relevant places that are affected by the typedef change.
>>
>> Fixes: 116819b9ed0d ("examples/performance-thread: add lthread subsystem")
>>
>> Signed-off-by: David Hunt <david.hunt at intel.com>
>> ---
> [...]
>> -static void initial_lthread(void *args);
>> -static void initial_lthread(void *args __attribute__((unused)))
>> +static void *initial_lthread(void *args);
> This declaration can be removed.
>
>> +static void *initial_lthread(void *args __attribute__((unused)))
>>   {
> The function must return a pointer (like NULL) at the end.
>
> Please check that all threads are returning something.
>

Sure, Thomas, I've made updates based on your suggestions and pushed up 
a v2.
Rgds,
Dave.


More information about the dev mailing list