From 61909fa24e62c623959d33a5934a6853a9decd4a Mon Sep 17 00:00:00 2001 From: "Yury V. Zaytsev" Date: Sat, 26 Oct 2024 18:06:58 +0200 Subject: [PATCH] mountlist: suppress unused label warning on FreeBSD Signed-off-by: Yury V. Zaytsev --- configure.ac | 1 + lib/global.h | 6 ++++++ src/filemanager/mountlist.c | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 0934a4548..d598b95cb 100644 --- a/configure.ac +++ b/configure.ac @@ -66,6 +66,7 @@ ax_gcc_func_attribute_save_flags=$[]_AC_LANG_PREFIX[]FLAGS _AC_LANG_PREFIX[]FLAGS= AX_GCC_FUNC_ATTRIBUTE([fallthrough]) AX_GCC_FUNC_ATTRIBUTE([weak]) +AX_GCC_FUNC_ATTRIBUTE([unused]) _AC_LANG_PREFIX[]FLAGS=$ax_gcc_func_attribute_save_flags unset ax_gcc_func_attribute_save_flags diff --git a/lib/global.h b/lib/global.h index 65454d15c..a09607eb2 100644 --- a/lib/global.h +++ b/lib/global.h @@ -50,6 +50,12 @@ #define MC_FALLTHROUGH #endif +#ifdef HAVE_FUNC_ATTRIBUTE_UNUSED +#define MC_UNUSED __attribute__((unused)) +#else +#define MC_UNUSED +#endif + #ifdef USE_MAINTAINER_MODE #include "lib/logging.h" #endif diff --git a/src/filemanager/mountlist.c b/src/filemanager/mountlist.c index bab6aa1f7..4cfad4dce 100644 --- a/src/filemanager/mountlist.c +++ b/src/filemanager/mountlist.c @@ -1215,7 +1215,7 @@ read_file_system_list (void) return g_slist_reverse (mount_list); - free_then_fail: + free_then_fail: MC_UNUSED; { int saved_errno = errno;