From 3960449374595248577fa916dc1a40f49badd03f Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sat, 9 Jul 2022 17:08:21 +0300 Subject: [PATCH] Detech -Wno-unused-functions for GCC too MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Otherwise build fails [1]: /home/runner/work/libevent/libevent/dist/libevent-2.2.0-alpha-dev/minheap-internal.h:64:6: error: ‘min_heap_ctor_’ defined but not used [-Werror=unused-function] void min_heap_ctor_(min_heap_t* s) { s->p = 0; s->n = 0; s->a = 0; } ^~~~~~~~~~~~~~ In file included from /home/runner/work/libevent/libevent/dist/libevent-2.2.0-alpha-dev/buffer.c:91:0: /home/runner/work/libevent/libevent/dist/libevent-2.2.0-alpha-dev/bufferevent-internal.h:414:1: error: ‘bufferevent_trigger_nolock_’ defined but not used [-Werror=unused-function] bufferevent_trigger_nolock_(struct bufferevent *bufev, short iotype, int options) ^~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /home/runner/work/libevent/libevent/dist/libevent-2.2.0-alpha-dev/buffer.c:89:0: /home/runner/work/libevent/libevent/dist/libevent-2.2.0-alpha-dev/evthread-internal.h:140:1: error: ‘EVLOCK_TRY_LOCK_’ defined but not used [-Werror=unused-function] EVLOCK_TRY_LOCK_(void *lock) [1]: https://github.com/libevent/libevent/runs/7263518180?check_suite_focus=true --- CMakeLists.txt | 4 +++- configure.ac | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index db345b02..799673de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -314,11 +314,13 @@ if (${GNUC}) -Wlogical-op -Wwrite-strings + + # Disable unused-function warnings. These trigger for minheap-internal.h. + -Wno-unused-function ) if (${CLANG}) list(APPEND __FLAGS - -Wno-unused-function # we use this hack in tests -Wno-void-pointer-to-enum-cast) endif() diff --git a/configure.ac b/configure.ac index a93f0304..85e02bd4 100644 --- a/configure.ac +++ b/configure.ac @@ -775,10 +775,10 @@ if test "$enable_gcc_warnings" != "no" && test "$GCC" = "yes"; then #error #endif])], have_clang=yes, have_clang=no) - if test "$have_clang" = "yes"; then - dnl Disable unused-function warnings. These trigger for minheap-internal.h. - AX_CHECK_COMPILE_FLAG([-Wno-unused-function], [CFLAGS="$CFLAGS -Wno-unused-function"],[],[-Werror]) + dnl Disable unused-function warnings. These trigger for minheap-internal.h. + AX_CHECK_COMPILE_FLAG([-Wno-unused-function], [CFLAGS="$CFLAGS -Wno-unused-function"],[],[-Werror]) + if test "$have_clang" = "yes"; then case "$host_os" in darwin*) dnl Clang on macOS emits warnings for each directory specified which -- 2.40.0