<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 - Invalid "conflicting types for" in header"
   href="https://bugs.llvm.org/show_bug.cgi?id=37529">37529</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Invalid "conflicting types for" in header
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </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>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>ethan@ethanhs.me
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I'm working on porting CPython to work with clang-cl on Windows, so first off
thank you for clang-cl! 

I've recently hit an edge case which MSC will compile, but clang will refuse to
compile.

Here is a minimal example that shows the issue:

// example.h

float difference(struct timeval *start, struct timeval *end);

// example.c

#include "example.h"

#include <windows.h>

 float difference(struct timeval *start, struct timeval *end) {
         return end->tv_sec - start->tv_sec;
}

Clang will report "conflicting types for 'difference'" which seems to be due to
the fact it assumes struct timeval in example.h references a new struct, which
is wrong.

I'd normally just move the include of Windows.h into example.h as a work
around, but this isn't always practical. In CPython, the real file is pytime.h,
which is included in Python.h, which is included in just about everthing...

I believe it isn't too uncommon for this pattern to exist, so it'd be great if
it were supported. Thanks!</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>