[LLVMbugs] [Bug 19453] New: scan-build silently fails to analyze files with -m in filename

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 16 14:31:49 PDT 2014


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

            Bug ID: 19453
           Summary: scan-build silently fails to analyze files with -m in
                    filename
           Product: clang
           Version: 3.3
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: matt.sexton at redlinetrading.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

If a filename is passed to scan-build with a -m in it, no analysis on the file
is performed.

>scan-build clang -c a-m.c 
scan-build: Using '/usr/bin/clang' for static analysis
scan-build: Removing directory '/tmp/scan-build-2014-04-16-276' because it
contains no reports.
scan-build: No bugs found.

>cp a-m.c a-o.c

>scan-build clang -c a-o.c 
scan-build: Using '/usr/bin/clang' for static analysis
a-o.c:13:6: warning: Address of stack memory associated with local variable
'rc' returned to caller
     return prc;
     ^~~~~~~~~~
1 warning generated.
scan-build: 1 bugs found.

>cat a-o.c 
#include <stdlib.h>

void *foo( void )
{
     void *prc = NULL;
     int rc = 0;

     rc = system("a");
     if ( rc != 0 ) {
          prc = &rc;
     }  

     return prc;
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140416/496ccd5b/attachment.html>


More information about the llvm-bugs mailing list