<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </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 fails to parse mingw-w64's secure api headers (cannot add 'dllimport' attribute)"
   href="http://llvm.org/bugs/show_bug.cgi?id=20746">20746</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang fails to parse mingw-w64's secure api headers (cannot add 'dllimport' attribute)
          </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>Linux
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>release blocker
          </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>t.poechtrager@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=12933" name="attach_12933" title="Preprocessed source file">attachment 12933</a> <a href="attachment.cgi?id=12933&action=edit" title="Preprocessed source file">[details]</a></span>
Preprocessed source file

$ cat test.c
#include <wchar.h>
#include <conio.h>
int main(){return 0;}

#### clang 3.4 ####

$ clang -target i686-w64-mingw32 -nostdinc \
  -isystem /opt/other/llvm-3.4/bin/../lib/clang/3.4.2/include \
  -isystem /opt/other/mingw/i686-w64-mingw32/include \
  test.c

works.

#### clang - trunk / 3.5 ####

$ clang -target i686-w64-mingw32 -nostdinc \
  -isystem /opt/other/llvm-trunk/bin/../lib/clang/3.6.0/include \
  -isystem /opt/other/mingw/i686-w64-mingw32/include \
  test.c

results in:

In file included from test.c:2:
In file included from /opt/other/mingw/i686-w64-mingw32/include/conio.h:125:
/opt/other/mingw/i686-w64-mingw32/include/sec_api/conio_s.h:30:27: error:
redeclaration of '_cgetws_s' cannot add 'dllimport' attribute
  _CRTIMP errno_t __cdecl _cgetws_s (wchar_t *_Buffer,size_t
_SizeInWords,size_t *_SizeRead);
                          ^
/opt/other/mingw/i686-w64-mingw32/include/sec_api/wchar_s.h:25:19: note:
previous declaration is here
  errno_t __cdecl _cgetws_s (wchar_t *_Buffer,size_t _SizeInWords,size_t
*_SizeRead);
                  ^
----

It would be great if clang could accept such header files with a warning
instead of an hard error, as this renders the MinGW target quite unusable
with certain header files included.

----

Preprocessed source file is attached.</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>