mysql guy
mysql guy

Reputation: 245

what's the meaning of VOID() in C

what's the meaning of VOID()

There are the following C code, but what's it's meaning?

VOID(pthread_mutex_init(&tina_mutex,MY_MUTEX_INIT_FAST));

Upvotes: 2

Views: 338

Answers (2)

xs0
xs0

Reputation: 2897

pthread_mutex_init returns 0 on success or an error value. I think the macro you have just casts this result to void, thereby convincing the compiler that it shouldn't emit a warning about ignoring the return value..

Upvotes: 4

M.K.
M.K.

Reputation: 346

Looks like a preprocessor macro. Your editor should be able to find what it is. Or try

gcc -E source.c > source2.c

It runs the preprocessor only and replaces macros with what they really evaluate to.

Upvotes: 5

Related Questions