<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:t.poechtrager@gmail.com" title="Thomas Pöchtrager <t.poechtrager@gmail.com>"> <span class="fn">Thomas Pöchtrager</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED --- - clang fails to parse mingw-w64's secure api headers (cannot add 'dllimport' attribute)"
   href="http://llvm.org/bugs/show_bug.cgi?id=20746">bug 20746</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>RESOLVED
           </td>
           <td>REOPENED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>FIXED
           </td>
           <td>---
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED --- - clang fails to parse mingw-w64's secure api headers (cannot add 'dllimport' attribute)"
   href="http://llvm.org/bugs/show_bug.cgi?id=20746#c14">Comment # 14</a>
              on <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED --- - clang fails to parse mingw-w64's secure api headers (cannot add 'dllimport' attribute)"
   href="http://llvm.org/bugs/show_bug.cgi?id=20746">bug 20746</a>
              from <span class="vcard"><a class="email" href="mailto:t.poechtrager@gmail.com" title="Thomas Pöchtrager <t.poechtrager@gmail.com>"> <span class="fn">Thomas Pöchtrager</span></a>
</span></b>
        <pre>There is still an issue with 'extern "C"':

--

$ cat test.c
typedef struct localeinfo_struct {
  char dummy;
} _locale_tstruct,*_locale_t;

#ifdef __cplusplus
extern "C" {
#endif
  int __attribute__((__cdecl__)) _scanf_l(const char * __restrict__
format,_locale_t locale,... ) ;
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
  __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _scanf_l(const
char *_Format,_locale_t _Locale,...);
#ifdef __cplusplus
}
#endif

--

$ clang -target i686-w64-mingw32 test.c -fsyntax-only
test.c:16:66: warning: redeclaration of '_scanf_l' should not add 'dllimport'
attribute [-Wdll-attribute-on-redeclaration]
  __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _scanf_l(const
char *_Format,_locale_t _Locale,...);
                                                                 ^
test.c:8:34: note: previous declaration is here
  int __attribute__((__cdecl__)) _scanf_l(const char * __restrict__
format,_locale_t locale,... ) ;
                                 ^
1 warning generated.

--

$ clang++ -target i686-w64-mingw32 -xc++ test.c -fsyntax-only
test.c:16:66: error: redeclaration of '_scanf_l' cannot add 'dllimport'
attribute
  __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _scanf_l(const
char *_Format,_locale_t _Locale,...);
                                                                 ^
test.c:8:34: note: previous declaration is here
  int __attribute__((__cdecl__)) _scanf_l(const char * __restrict__
format,_locale_t locale,... ) ;
                                 ^
1 error generated.</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>