[newlib-cygwin/main] Cygwin: cygcheck: fix a new warning with gcc 16

Jon Turney jturney@sourceware.org
Fri Jun 5 11:52:50 GMT 2026


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=54692d3ad6c0b0b360e13c47f23046788676554c

commit 54692d3ad6c0b0b360e13c47f23046788676554c
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Mon Jun 1 14:48:11 2026 +0100

    Cygwin: cygcheck: fix a new warning with gcc 16
    
    The mingW-targetted gcc available in Fedora is now gcc 16.
    
    > ../../../../../winsup/utils/mingw/cygcheck.cc: In function 'void dump_sysinfo()':
    > ../../../../../winsup/utils/mingw/cygcheck.cc:1716:11: error: variable 'count_path_items' set but not used [-Werror=unused-but-set-variable=]
    
    As far as I can tell, the value of count_path_items we compute has never
    been used.
    
    Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>

Diff:
---
 winsup/utils/mingw/cygcheck.cc | 2 --
 1 file changed, 2 deletions(-)

diff --git a/winsup/utils/mingw/cygcheck.cc b/winsup/utils/mingw/cygcheck.cc
index d17909bfc..e6374d712 100644
--- a/winsup/utils/mingw/cygcheck.cc
+++ b/winsup/utils/mingw/cygcheck.cc
@@ -1713,7 +1713,6 @@ dump_sysinfo ()
   else
     {
       char sep = strchr (s, ';') ? ';' : ':';
-      int count_path_items = 0;
       while (1)
 	{
 	  for (e = s; *e && *e != sep; e++);
@@ -1721,7 +1720,6 @@ dump_sysinfo ()
 	    printf ("\t%.*s\n", (int) (e - s), s);
 	  else
 	    puts ("\t.");
-	  count_path_items++;
 	  if (!*e)
 	    break;
 	  s = e + 1;


More information about the Cygwin-cvs mailing list