Jeremy Drake via Cygwin wrote:
On Fri, 12 Sep 2025, Christian Franke via Cygwin wrote:

Testcase:

$ cat winapi.c
#include <windows.h>
int WINAPI SomeDllFunction(int, int, int, int, int);

int call_it()
{
    return SomeDllFunction(1, 2, 3, 4, 5);
}

$ clang -S winapi.c  # with 20.1.8 and 21.1.1
winapi.c:2:5: warning: '__stdcall__' calling convention is not supported
for this target
        [-Wignored-attributes]
      2 | int WINAPI SomeDllFunction(int, int, int, int, int);
        |     ^
/usr/include/w32api/minwindef.h:98:16: note: expanded from macro 'WINAPI'
     98 | #define WINAPI __stdcall
        |                ^
<built-in>:400:34: note: expanded from macro '__stdcall'
    400 | #define __stdcall __attribute__((__stdcall__))
        |                                  ^
...
This should be fixed in 21.1.1-2, just uploaded.  Thanks for the report.

Now no warnings occur for ABI attributes stdcall, cdecl, ms_abi and sysv_abi. Only the latter results in different function call code (6 instead of 4 parameters in registers, additional push/pop if xmm registers). This is consistent with gcc.

clang and x86_64-w64-mingw32-clang generate identical assembly files.

--
Thanks,
Christian


--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to