From 12598663bce341dc7ac070c449f2c1decae3b1af Mon Sep 17 00:00:00 2001 From: Chris Eibl <138194463+chris-eibl@users.noreply.github.com> Date: Tue, 10 Jun 2025 02:05:06 +0200 Subject: [PATCH] Fix warnings `set but not used [-Wunused-but-set-variable]` in remote_debug.h (GH-135290) (cherry picked from commit 49fc1f215aeb0f71445505191ccb65517b58a5aa) Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com> --- Python/remote_debug.h | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Python/remote_debug.h b/Python/remote_debug.h index 0a817bdbd488e0..2022e44a369869 100644 --- a/Python/remote_debug.h +++ b/Python/remote_debug.h @@ -674,8 +674,6 @@ search_linux_map_for_section(proc_handle_t *handle, const char* secname, const c } uintptr_t retval = 0; - int lines_processed = 0; - int matches_found = 0; while (fgets(line + linelen, linesz - linelen, maps_file) != NULL) { linelen = strlen(line); @@ -700,7 +698,6 @@ search_linux_map_for_section(proc_handle_t *handle, const char* secname, const c line[linelen - 1] = '\0'; // and prepare to read the next line into the start of the buffer. linelen = 0; - lines_processed++; unsigned long start = 0; unsigned long path_pos = 0; @@ -721,7 +718,6 @@ search_linux_map_for_section(proc_handle_t *handle, const char* secname, const c } if (strstr(filename, substr)) { - matches_found++; retval = search_elf_file_for_section(handle, secname, start, path); if (retval) { break; @@ -840,15 +836,10 @@ search_windows_map_for_section(proc_handle_t* handle, const char* secname, const MODULEENTRY32W moduleEntry; moduleEntry.dwSize = sizeof(moduleEntry); void* runtime_addr = NULL; - int modules_examined = 0; - int matches_found = 0; for (BOOL hasModule = Module32FirstW(hProcSnap, &moduleEntry); hasModule; hasModule = Module32NextW(hProcSnap, &moduleEntry)) { - modules_examined++; - // Look for either python executable or DLL if (wcsstr(moduleEntry.szModule, substr)) { - matches_found++; runtime_addr = analyze_pe(moduleEntry.szExePath, moduleEntry.modBaseAddr, secname); if (runtime_addr != NULL) { break;