From 2067b435515a64ca064d61748220c87e0521a11b Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 22 Nov 2025 12:40:59 -0500 Subject: [PATCH 1/2] fix warning on wingui/pdcsrcn.c MSYS2 ARM64 compiling on MSYS2 Windows 11 ARM64 clang version 21.1.5 Target: aarch64-w64-windows-gnu Thread model: posix InstalledDir: C:/msys64/clangarm64/bin ../wingui/pdcscrn.c:1622:16: warning: unknown attribute 'force_align_arg_pointer' ignored [-Wunknown-attributes] 1622 | static LRESULT ALIGN_STACK CALLBACK WndProc (const HWND hwnd, | ^~~~~~~~~~~ ../wingui/pdcscrn.c:1617:36: note: expanded from macro 'ALIGN_STACK' 1617 | #define ALIGN_STACK __attribute__((force_align_arg_pointer)) | ^~~~~~~~~~~~~~~~~~~~~~~ 1 warning generated. --- wingui/pdcscrn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wingui/pdcscrn.c b/wingui/pdcscrn.c index 35613699..af51de8e 100644 --- a/wingui/pdcscrn.c +++ b/wingui/pdcscrn.c @@ -1613,7 +1613,7 @@ Note, though, that in Win9x, detection of the Shift keys is hardware dependent; if you've an unusual keyboard, both Shift keys may be detected as right, or both as left. */ -#if defined(_WIN32) && defined(__GNUC__) +#if defined(_WIN32) && defined(__GNUC__) && !defined(_ARM64_) #define ALIGN_STACK __attribute__((force_align_arg_pointer)) #else #define ALIGN_STACK From c57e1f235b7fa2a115769345a93c71e475795c04 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 23 Nov 2025 07:08:57 -0500 Subject: [PATCH 2/2] revised as per suggestion from Bill Gray Bill Gray suggested using __has_attribute() to test for the availability of the __attribute__((force_align_arg_pointer)) --- wingui/pdcscrn.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wingui/pdcscrn.c b/wingui/pdcscrn.c index af51de8e..d0f3d109 100644 --- a/wingui/pdcscrn.c +++ b/wingui/pdcscrn.c @@ -1613,9 +1613,12 @@ Note, though, that in Win9x, detection of the Shift keys is hardware dependent; if you've an unusual keyboard, both Shift keys may be detected as right, or both as left. */ -#if defined(_WIN32) && defined(__GNUC__) && !defined(_ARM64_) +#if defined(__has_attribute) +#if __has_attribute(force_align_arg_pointer) #define ALIGN_STACK __attribute__((force_align_arg_pointer)) -#else +#endif +#endif +#if !defined(ALIGN_STACK) #define ALIGN_STACK #endif