http://llvm.org/bugs/show_bug.cgi?id=10141
Summary: pthread_mutex_lock is assumed to always return 0
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: Static Analyzer
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
With this code
{
int lock_res = pthread_mutex_lock(&o->lock);
if(lock_res != 0) return false;
if(o->destroyed)
{
pthread_mutex_unlock(&o->lock);
return false;
}
}
Clang says:
us_datacoding_datacoding.c:163:21: warning: This statement is never executed
if(lock_res != 0) return false;
pointing at the return false;
In my case, the mutex o->lock is created as PTHREAD_MUTEX_ERRORCHECK which is
allowed to return !0.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs