From: Ivan Maidanski Date: Thu, 30 May 2019 20:57:46 +0000 (+0300) Subject: Fix 'GC_old_bus_handler defined but not used' compiler warning X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=41b05756b73dbc50f270c2de13c95ef666e584e8;p=gc Fix 'GC_old_bus_handler defined but not used' compiler warning * os_dep.c [!DARWIN && !MSWIN32 && !MSWINCE] (GC_old_bus_handler): Define variable only if FREEBSD or HPUX, or HURD, or LINUX. * os_dep.c [!DARWIN && !MSWIN32 && !MSWINCE && (HPUX || HURD || FREEBSD)] (GC_dirty_init): Do not set GC_old_bus_handler_used_si to FALSE (because it is already initialized to FALSE). --- diff --git a/os_dep.c b/os_dep.c index 27afee1c..0e6226d2 100644 --- a/os_dep.c +++ b/os_dep.c @@ -3073,11 +3073,13 @@ GC_API GC_push_other_roots_proc GC_CALL GC_get_push_other_roots(void) #ifndef DARWIN STATIC SIG_HNDLR_PTR GC_old_segv_handler = 0; /* Also old MSWIN32 ACCESS_VIOLATION filter */ -# if !defined(MSWIN32) && !defined(MSWINCE) +# if defined(FREEBSD) || defined(HPUX) || defined(HURD) || defined(LINUX) STATIC SIG_HNDLR_PTR GC_old_bus_handler = 0; -# if defined(FREEBSD) || defined(HURD) || defined(HPUX) +# ifndef LINUX STATIC GC_bool GC_old_bus_handler_used_si = FALSE; # endif +# endif +# if !defined(MSWIN32) && !defined(MSWINCE) STATIC GC_bool GC_old_segv_handler_used_si = FALSE; # endif /* !MSWIN32 */ #endif /* !DARWIN */ @@ -3334,9 +3336,6 @@ GC_API GC_push_other_roots_proc GC_CALL GC_get_push_other_roots(void) # endif } else { GC_old_bus_handler = (SIG_HNDLR_PTR)(signed_word)oldact.sa_handler; -# if !defined(LINUX) - GC_old_bus_handler_used_si = FALSE; -# endif } if (GC_old_bus_handler == (SIG_HNDLR_PTR)(signed_word)SIG_IGN) { WARN("Previously ignored bus error!?\n", 0);