clang 20.1.8+21.1.1: __stdcall__ warning only from Cygwin version

Christian Franke Christian.Franke@t-online.de
Fri Sep 12 11:28:42 GMT 2025


First of all: thanks for providing recent clang packages!

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__))
       |                                  ^
1 warning generated.

$ clang -Wsystem-headers -S winapi.c 2>&1 \
| grep -c 'warning:.*stdcall.* not supported'
8082

$ x86_64-w64-mingw32-clang -Wsystem-headers -S winapi.c 2>&1 \
| grep -c 'warning:.*stdcall.* not supported'
0

The generated assembly code is identical.

The warning does not occur with __cdecl__ attribute (no difference from 
__stdcall__ in the x86_64 ABI).

-- 
Regards,
Christian



More information about the Cygwin mailing list