0
我有以下的C代碼:pthread_cleanup_push與調用pthread_mutex_unlock
pthread_cleanup_push(pthread_mutex_unlock, &mutex);
但是當我編譯它,我得到以下警告:
warning: initialization from incompatible pointer type
有什麼不對?它看起來像清理處理程序應該返回void *,而不是int。有沒有辦法繞過這個警告,而不寫另外的包裝?
這是一個非常明確的警告。你與什麼部分糾纏?您是否閱讀過這裏涉及的所有函數的手冊? –
可能[duplicate](http://stackoverflow.com/questions/6119140/c-gcc-warning-initialization-from-incompatible-pointer-type-when-calling-pthr) – Hariprasad
你們倆都錯過了實際的問題。 –