[英]what's the meaning of VOID() in C
what's the meaning of VOID()
VOID()
是什么意思
There are the following C code, but what's it's meaning?有下面的C代码,但是是什么意思呢?
VOID(pthread_mutex_init(&tina_mutex,MY_MUTEX_INIT_FAST));
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.它只运行预处理器,并用它们真正评估的内容替换宏。
pthread_mutex_init returns 0 on success or an error value. pthread_mutex_init 在成功或错误值时返回 0。 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..
我认为您刚刚将此结果转换为 void 的宏,从而使编译器相信它不应该发出有关忽略返回值的警告。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.