On 9/19/26 17:44, Bruno Haible via Gnulib discussion list wrote:
Like this:

#if _GL_GNUC_PREREQ (4, 2)
# pragma GCC diagnostic ignored "-Waddress"
#endif

OK, thanks, I did that by installing the attached patch into Gnulib and merging Gnulib into Emacs master. This should fix the Gnulib-related false positives reported in Bug#81837.
From 026ae7f8e532679a023a544a0fb7270806e1ea17 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email protected]>
Date: Sat, 19 Sep 2026 12:33:28 -0700
Subject: [PATCH] Pacify -Waddress on MS-Windows

Problem reported by Yue Yi <https://bugs.gnu.org/81837#23>.
* lib/boot-time-aux.h (GetTickCount64Func):
* lib/getrandom.c (BCryptGenRandomFunc):
* lib/gettimeofday.c (GetSystemTimePreciseAsFileTimeFunc):
* lib/link.c (CreateHardLinkFunc):
* lib/stat-w32.c (GetFileInformationByHandleExFunc):
When defining these macros for Vista and later, and when GCC 4.2
or later, ignore -Waddress.
---
 ChangeLog           | 12 ++++++++++++
 lib/boot-time-aux.h |  3 +++
 lib/getrandom.c     |  3 +++
 lib/gettimeofday.c  |  3 +++
 lib/link.c          |  3 +++
 lib/stat-w32.c      |  3 +++
 6 files changed, 27 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 1d6cdc6762..674ad576f4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2026-09-19  Paul Eggert  <[email protected]>
+
+	Pacify -Waddress on MS-Windows
+	Problem reported by Yue Yi <https://bugs.gnu.org/81837#23>.
+	* lib/boot-time-aux.h (GetTickCount64Func):
+	* lib/getrandom.c (BCryptGenRandomFunc):
+	* lib/gettimeofday.c (GetSystemTimePreciseAsFileTimeFunc):
+	* lib/link.c (CreateHardLinkFunc):
+	* lib/stat-w32.c (GetFileInformationByHandleExFunc):
+	When defining these macros for Vista and later, and when GCC 4.2
+	or later, ignore -Waddress.
+
 2026-09-19  Pádraig Brady  <[email protected]>
 
 	regex: check for glibc greek locale bug 20381
diff --git a/lib/boot-time-aux.h b/lib/boot-time-aux.h
index e09d84b67a..a6f2f09ea7 100644
--- a/lib/boot-time-aux.h
+++ b/lib/boot-time-aux.h
@@ -375,6 +375,9 @@ initialize (void)
 #  else
 
 #   define GetTickCount64Func GetTickCount64
+#   if _GL_GNUC_PREREQ (4, 2)
+#    pragma GCC diagnostic ignored "-Waddress"
+#   endif
 
 #  endif
 
diff --git a/lib/getrandom.c b/lib/getrandom.c
index 7bc5a4b416..e436ee2f30 100644
--- a/lib/getrandom.c
+++ b/lib/getrandom.c
@@ -83,6 +83,9 @@ initialize (void)
 # else
 
 #  define BCryptGenRandomFunc BCryptGenRandom
+#  if _GL_GNUC_PREREQ (4, 2)
+#   pragma GCC diagnostic ignored "-Waddress"
+#  endif
 
 # endif
 
diff --git a/lib/gettimeofday.c b/lib/gettimeofday.c
index f236c427fd..a3885dbfe5 100644
--- a/lib/gettimeofday.c
+++ b/lib/gettimeofday.c
@@ -61,6 +61,9 @@ initialize (void)
 # else
 
 #  define GetSystemTimePreciseAsFileTimeFunc GetSystemTimePreciseAsFileTime
+#  if _GL_GNUC_PREREQ (4, 2)
+#   pragma GCC diagnostic ignored "-Waddress"
+#  endif
 
 # endif
 
diff --git a/lib/link.c b/lib/link.c
index 6198929943..297e72db12 100644
--- a/lib/link.c
+++ b/lib/link.c
@@ -64,6 +64,9 @@ initialize (void)
 #  else
 
 #   define CreateHardLinkFunc CreateHardLink
+#   if _GL_GNUC_PREREQ (4, 2)
+#    pragma GCC diagnostic ignored "-Waddress"
+#   endif
 
 #  endif
 
diff --git a/lib/stat-w32.c b/lib/stat-w32.c
index e5a9e28688..b5abd77f89 100644
--- a/lib/stat-w32.c
+++ b/lib/stat-w32.c
@@ -83,6 +83,9 @@ initialize (void)
 #else
 
 # define GetFileInformationByHandleExFunc GetFileInformationByHandleEx
+# if _GL_GNUC_PREREQ (4, 2)
+#  pragma GCC diagnostic ignored "-Waddress"
+# endif
 
 #endif
 
-- 
2.55.0

Reply via email to