sanjihan
sanjihan

Reputation: 6024

Meaning of: void * _Nullable (* _Nonnull)(void * _Nullable)

I am passing functions to pthread_create function. I am getting a warning that complains about incompatible type of function passed as an argument:

void * _Nullable (* _Nonnull)(void * _Nullable)

I managed to fix it by declaring my function as:

void *incFunc(void *ptr){
    for (long i = 0; i < COUNT; ++i) { counter++;}
    return NULL;
}

, but I don't really understand the meaning of expected argument type:

void * _Nullable (* _Nonnull)(void * _Nullable)

What does (* _Nonnull) represent?

Upvotes: 2

Views: 1962

Answers (1)

0___________
0___________

Reputation: 67741

That means:

it has to be not NULL function pointer taking void * parameter which can be NULL and returning void *. The return value can be NULL.

Upvotes: 3

Related Questions