[PATCH] Cygwin: fix compatibility with GCC 15

Radek Barton radek.barton@microsoft.com
Mon Jun 16 11:44:11 GMT 2025


Hello.

This patch is a follow-up of https://cygwin.com/pipermail/cygwin-patches/2024q4/013051.html and https://cygwin.com/pipermail/cygwin-patches/2025q1/013561.html for the changes that happened since then.

Radek

---
>From 9dff21cfdcf650256711b12d8d04fef3ca072afb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Radek=20Barto=C5=88?= <radek.barton@microsoft.com>
Date: Thu, 5 Jun 2025 12:42:05 +0200
Subject: [PATCH] Cygwin: fix compatibility with GCC 15

---
 winsup/cygwin/create_posix_thread.cc    | 2 +-
 winsup/cygwin/local_includes/fhandler.h | 6 +++---
 winsup/cygwin/local_includes/thread.h   | 6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/winsup/cygwin/create_posix_thread.cc b/winsup/cygwin/create_posix_thread.cc
index 8e06099e4..3fcd61707 100644
--- a/winsup/cygwin/create_posix_thread.cc
+++ b/winsup/cygwin/create_posix_thread.cc
@@ -206,7 +206,7 @@ class thread_allocator
 public:
   thread_allocator () : current (THREAD_STORAGE_HIGH)
   {
-    alloc_func = wincap.has_extended_mem_api () ? &_alloc : &_alloc_old;
+    alloc_func = wincap.has_extended_mem_api () ? &thread_allocator::_alloc : &thread_allocator::_alloc_old;
   }
   PVOID alloc (SIZE_T size)
   {
diff --git a/winsup/cygwin/local_includes/fhandler.h b/winsup/cygwin/local_includes/fhandler.h
index 03f20c8fd..3d9bc9fa5 100644
--- a/winsup/cygwin/local_includes/fhandler.h
+++ b/winsup/cygwin/local_includes/fhandler.h
@@ -1699,9 +1699,9 @@ class fhandler_disk_file: public fhandler_base
   uint64_t fs_ioc_getflags ();
   int fs_ioc_setflags (uint64_t);
 
-  falloc_allocate (int, off_t, off_t);
-  falloc_punch_hole (off_t, off_t);
-  falloc_zero_range (int, off_t, off_t);
+  int falloc_allocate (int, off_t, off_t);
+  int falloc_punch_hole (off_t, off_t);
+  int falloc_zero_range (int, off_t, off_t);
 
  public:
   fhandler_disk_file ();
diff --git a/winsup/cygwin/local_includes/thread.h b/winsup/cygwin/local_includes/thread.h
index 3955609e2..cbbbc3f1e 100644
--- a/winsup/cygwin/local_includes/thread.h
+++ b/winsup/cygwin/local_includes/thread.h
@@ -221,12 +221,12 @@ public:
   ~pthread_key ();
   static void fixup_before_fork ()
   {
-    for_each (_fixup_before_fork);
+    for_each (&pthread_key::_fixup_before_fork);
   }
 
   static void fixup_after_fork ()
   {
-    for_each (_fixup_after_fork);
+    for_each (&pthread_key::_fixup_after_fork);
   }
 
   static void run_all_destructors ()
@@ -245,7 +245,7 @@ public:
     for (int i = 0; i < PTHREAD_DESTRUCTOR_ITERATIONS; ++i)
       {
 	iterate_dtors_once_more = false;
-	for_each (run_destructor);
+	for_each (&pthread_key::run_destructor);
 	if (!iterate_dtors_once_more)
 	  break;
       }
-- 
2.49.0.vfs.0.3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Cygwin-fix-compatibility-with-GCC-15.patch
Type: application/octet-stream
Size: 2472 bytes
Desc: 0001-Cygwin-fix-compatibility-with-GCC-15.patch
URL: <https://cygwin.com/pipermail/cygwin-patches/attachments/20250616/fbb93231/attachment.obj>


More information about the Cygwin-patches mailing list