[LLVMbugs] [Bug 8395] New: pthread_mutex_lock() modeling error

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Oct 17 03:21:35 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=8395

           Summary: pthread_mutex_lock() modeling error
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: dimhen at gmail.com
                CC: llvmbugs at cs.uiuc.edu


$ clang -v
clang version 2.9 (trunk 116687)
Target: x86_64-unknown-linux-gnu
Thread model: posix
s$ cat pthread_mutex_lock.c
#include <pthread.h>

static pthread_mutex_t m;

void foo()
{
    int err = 0;
    err = pthread_mutex_lock(&m);
    if(err)
        return;
    pthread_mutex_unlock(&m);
}
$ clang -cc1 pthread_mutex_lock.c -analyze -analyzer-check-objc-mem
-analyzer-experimental-checks
pthread_mutex_lock.c:10:2: warning: This statement is never executed
        return;
        ^~~~~~
1 warning generated.

-- 
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.



More information about the llvm-bugs mailing list