<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-cl can't be used with midl"
   href="https://bugs.llvm.org/show_bug.cgi?id=40140">40140</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang-cl can't be used with midl
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Linux
          </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>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>mh+llvm@glandium.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>midl, a tool part of the Windows SDK, defaults to use cl.exe as a preprocessor.
One can override that with the /cpp_cmd flag to midl, and for people trying not
to depend on MSVC at all, it would seem like a good idea to pass clang-cl
there. But that doesn't work.

midl invokes the preprocessor with the following command line:

$preprocessor -E -D__midl=801 path/to/file.idl

with clang-cl, this fails because -E is ignored and the idl file is considered
as a linker input. So it warns about command line arguments being unused, and
gives no preprocessed output.

e.g.:

$ c:/Users/glandium/.mozbuild/clang/bin/clang-cl.exe -E -D__midl=801
c:/Users/glandium/Desktop/mozilla-unified/accessible/ipc/win/typelib/Accessible.idl
clang-cl: warning:
c:/Users/glandium/Desktop/mozilla-unified/accessible/ipc/win/typelib/Accessible.idl:
'linker' input unused [-Wunused-command-line-argument]
clang-cl: warning: argument unused during compilation: '-D __midl=801'
[-Wunused-command-line-argument]</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>