[LLVMbugs] [Bug 20746] New: clang fails to parse mingw-w64's secure api headers (cannot add 'dllimport' attribute)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Aug 25 12:59:26 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20746

            Bug ID: 20746
           Summary: clang fails to parse mingw-w64's secure api headers
                    (cannot add 'dllimport' attribute)
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: t.poechtrager at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12933
  --> http://llvm.org/bugs/attachment.cgi?id=12933&action=edit
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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140825/3a406ba5/attachment.html>


More information about the llvm-bugs mailing list