[llvm-bugs] [Bug 34986] New: clang rejects --analyze parameter

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Oct 17 14:17:12 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=34986

            Bug ID: 34986
           Summary: clang rejects --analyze parameter
           Product: clang
           Version: 5.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
          Assignee: dcoughlin at apple.com
          Reporter: msherman77 at gmail.com
                CC: llvm-bugs at lists.llvm.org

Hi.

I want to run clang --analyze against a legacy MFC/C++ code base on Windows.
In my Makefile, the CFLAGS looks like:

CFLAGS= -I$(RESOURCES)  -I$(IMPORTED_HEADERS) -I$(EXPORTED_HEADERS) 
-isystem$(ATL_MFC_INCLUDE) -isystem$(SDK7INCLUDE) -isystem$(VCINCLUDE)
-ferror-limit=0 -std=c++14 -fsyntax-only -Wmicrosoft -fms-extensions
-fms-compatibility -Wno-microsoft-extra-qualification -Wno-non-pod-varargs
-Wno-microsoft-cast -Wno-invalid-token-paste -Wno-inconsistent-dllimport
-D_ATL_NO_HOSTING -DUNICODE -D_UNICODE -DWIN32 -D_DEBUG -DDEBUG

No matter where I type --analyze, as a first or the last parameter, I get this
message:

clang.exe: warning: argument unused during compilation: '--analyze'
[-Wunused-command-line-argument]

However --analyze does work with a contrived example like this:

clang --analyze test.cpp, where test.cpp looks like that:

#include <string.h>

int main(int, char**)
{
    strcpy(NULL, "Hello");
    return 0;   
}

Regards,
Michael

-- 
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/20171017/06e7f23c/attachment.html>


More information about the llvm-bugs mailing list