From 06f534fa69d1edca5cbe6c0ad184935134f554ee Mon Sep 17 00:00:00 2001 From: Tony Finch Date: Fri, 31 Mar 2023 20:39:40 +0100 Subject: [PATCH] Avoid spurious compilation failures in liburcu headers When liburcu is not installed from a system package, its headers are not treated as system headers by the compiler, so BIND's -Werror and other warning options take effect. The liburcu headers have a lot of inline functions, some of which do not use all their arguments, which BIND's build treats as an error. --- lib/isc/include/isc/urcu.h | 6 ++++++ tests/bench/Makefile.am | 2 ++ tests/dns/Makefile.am | 2 ++ tests/isc/Makefile.am | 2 ++ 4 files changed, 12 insertions(+) diff --git a/lib/isc/include/isc/urcu.h b/lib/isc/include/isc/urcu.h index 5f4051d455..a52bdb0b78 100644 --- a/lib/isc/include/isc/urcu.h +++ b/lib/isc/include/isc/urcu.h @@ -15,6 +15,10 @@ #include +/* when urcu is not installed in a system header location */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" + /* Inline small (less than 10 lines) functions */ #define URCU_INLINE_SMALL_FUNCTIONS @@ -30,6 +34,8 @@ #include #include +#pragma GCC diagnostic pop + #if defined(RCU_QSBR) /* diff --git a/tests/bench/Makefile.am b/tests/bench/Makefile.am index 749b7dc49c..3b2bd54f31 100644 --- a/tests/bench/Makefile.am +++ b/tests/bench/Makefile.am @@ -4,6 +4,7 @@ AM_CFLAGS += -Wno-vla AM_CPPFLAGS += \ $(LIBUV_CFLAGS) \ + $(LIBURCU_CFLAGS) \ $(LIBISC_CFLAGS) \ $(LIBDNS_CFLAGS) \ -I$(top_srcdir)/fuzz \ @@ -13,6 +14,7 @@ AM_CPPFLAGS += \ LDADD += \ $(LIBUV_LIBS) \ + $(LIBURCU_LIBS) \ $(LIBISC_LIBS) \ $(LIBDNS_LIBS) \ $(top_builddir)/tests/libtest/libtest.la diff --git a/tests/dns/Makefile.am b/tests/dns/Makefile.am index 137a159221..5469e89043 100644 --- a/tests/dns/Makefile.am +++ b/tests/dns/Makefile.am @@ -4,6 +4,7 @@ AM_CPPFLAGS += \ $(LIBISC_CFLAGS) \ $(LIBDNS_CFLAGS) \ $(LIBUV_CFLAGS) \ + $(LIBURCU_CFLAGS) \ $(KRB5_CFLAGS) \ -DSRCDIR=\"$(abs_srcdir)\" \ -DBUILDDIR=\"$(abs_builddir)\" \ @@ -13,6 +14,7 @@ AM_CPPFLAGS += \ LDADD += \ $(LIBISC_LIBS) \ $(LIBUV_LIBS) \ + $(LIBURCU_LIBS) \ $(LIBDNS_LIBS) check_PROGRAMS = \ diff --git a/tests/isc/Makefile.am b/tests/isc/Makefile.am index c6c99822c0..0db34d7ace 100644 --- a/tests/isc/Makefile.am +++ b/tests/isc/Makefile.am @@ -2,11 +2,13 @@ include $(top_srcdir)/Makefile.top AM_CPPFLAGS += \ $(LIBISC_CFLAGS) \ + $(LIBURCU_CFLAGS) \ $(LIBUV_CFLAGS) \ -I$(top_srcdir)/lib/isc LDADD += \ $(LIBISC_LIBS) \ + $(LIBURCU_LIBS) \ $(LIBUV_LIBS) check_PROGRAMS = \