<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - clang rejects --analyze parameter"
   href="https://bugs.llvm.org/show_bug.cgi?id=34986">34986</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang rejects --analyze parameter
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>5.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Static Analyzer
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>dcoughlin@apple.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>msherman77@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>