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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to