llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.49k stars 11.78k forks source link

clang rejects --analyze parameter #34334

Open llvmbot opened 6 years ago

llvmbot commented 6 years ago
Bugzilla Link 34986
Version 5.0
OS Windows NT
Reporter LLVM Bugzilla Contributor

Extended Description

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

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

Regards, Michael

llvmbot commented 6 years ago

assigned to @devincoughlin