[LLVMbugs] [Bug 12421] New: Error is detected for function defined in header but no report is generated

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Mar 30 09:18:20 PDT 2012


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

             Bug #: 12421
           Summary: Error is detected for function defined in header but
                    no report is generated
           Product: clang
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: roland at utk.edu
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Given:
test.c:
#include "test.h"
int main(){
  return f();
}

test.h:
static int f() {
  int *i=0;
  return *i;
}

gives:
$ scan-build c++-analyzer test.cc
In file included from test.cc:1:
./test.h:3:10: warning: Dereference of null pointer (loaded from variable 'i')
  return *i;
         ^~
1 warning generated.
scan-build: Removing directory ... because it contains no reports.

Thus even though the error is detected correctly no report is generated for it.

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