]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Replace __attribute__((unused)) with ISC_ATTR_UNUSED attribute macro
authorOndřej Surý <ondrej@isc.org>
Tue, 10 Jan 2023 09:20:44 +0000 (10:20 +0100)
committerOndřej Surý <ondrej@isc.org>
Thu, 30 Mar 2023 21:29:25 +0000 (23:29 +0200)
Instead of marking the unused entities with UNUSED(x) macro in the
function body, use a `ISC_ATTR_UNUSED` attribute macro that expans to
C23 [[maybe_unused]] or __attribute__((__unused__)) as fallback.

39 files changed:
bin/dig/nslookup.c
bin/tests/test_server.c
contrib/dlz/modules/include/dlz_minimal.h
fuzz/dns_message_checksig.c
fuzz/dns_message_parse.c
fuzz/dns_name_fromtext_target.c
fuzz/dns_name_fromwire.c
fuzz/dns_rdata_fromwire_text.c
fuzz/fuzz.h
fuzz/isc_lex_getmastertoken.c
fuzz/isc_lex_gettoken.c
lib/dns/include/dns/librpz.h
lib/dns/include/dns/trace.h
lib/isc/hashmap.c
lib/isc/include/isc/attributes.h
lib/isc/include/isc/netmgr.h
lib/isc/include/isc/util.h
lib/isc/netmgr/netmgr-int.h
lib/isc/netmgr/netmgr.c
tests/dns/dnstap_test.c
tests/dns/zt_test.c
tests/include/tests/isc.h
tests/include/tests/ns.h
tests/isc/doh_test.c
tests/isc/hmac_test.c
tests/isc/loop_test.c
tests/isc/md_test.c
tests/isc/netmgr_common.c
tests/isc/netmgr_common.h
tests/isc/tcp_test.c
tests/isc/tcpdns_test.c
tests/isc/timer_test.c
tests/isc/tls_test.c
tests/isc/tlsdns_test.c
tests/isc/udp_test.c
tests/isc/uv_wrap.h
tests/libtest/isc.c
tests/libtest/ns.c
tests/ns/netmgr_wrap.c

index 1012a99bd02b21a9d0901bd10615829428c4b811..dc43f7cdcf3e60520576135a87f19d510ba168b4 100644 (file)
@@ -888,7 +888,7 @@ static void
 start_next_command(void);
 
 static void
-process_next_command(void *arg __attribute__((__unused__))) {
+process_next_command(void *arg ISC_ATTR_UNUSED) {
        isc_loop_t *loop = isc_loop_main(loopmgr);
        if (cmdline == NULL) {
                in_use = false;
index e0d3bb45ec8798a60d277488b0c92eabebf7735d..6186a7a2a08e3e2b18fd2f6c3363a2e8bb073542 100644 (file)
@@ -39,7 +39,7 @@ static isc_nm_t *netmgr = NULL;
 static protocol_t protocol;
 static in_port_t port;
 static isc_netaddr_t netaddr;
-static isc_sockaddr_t sockaddr __attribute__((unused));
+static isc_sockaddr_t sockaddr ISC_ATTR_UNUSED;
 static int workers;
 
 static isc_tlsctx_t *tls_ctx = NULL;
index 7acdbb19caf2c32fe7c3a7800cd6b25e4b168adb..32f0f12f93601c2bec3a547ce92214e84dae77d4 100644 (file)
@@ -85,11 +85,13 @@ typedef uint32_t     dns_ttl_t;
                var = _u.v;            \
        } while (0)
 
-#if !defined(__has_attribute)
-#define __has_attribute(x) 0
-#endif /* if !defined(__has_attribute) */
+#if !defined(__has_c_attribute)
+#define __has_c_attribute(x) 0
+#endif /* if !defined(__has_c_attribute) */
 
-#if __GNUC__ >= 7 || __has_attribute(fallthrough)
+#if __has_c_attribute(fallthrough)
+#define FALLTHROUGH [[fallthrough]]
+#elif __GNUC__ >= 7 && !defined(__clang__)
 #define FALLTHROUGH __attribute__((fallthrough))
 #else
 /* clang-format off */
index 5c8f81aeb91851a5692e0aea098fd60741bca69b..b21665c4bf834266b0e7a2f657ee0d6ffbcfae9b 100644 (file)
@@ -177,8 +177,7 @@ cleanup(void) {
 }
 
 int
-LLVMFuzzerInitialize(int *argc __attribute__((unused)),
-                    char ***argv __attribute__((unused))) {
+LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_UNUSED) {
        isc_result_t result;
        dns_fixedname_t fixed;
        dns_name_t *name = dns_fixedname_initname(&fixed);
index c6b23ebf82d2c592dfc1d09886e8dc7d13dd605c..a2366f85f81dec8dd3401d0ee1a201ddf7d1c21b 100644 (file)
@@ -35,8 +35,7 @@ static size_t output_len = 1024;
 static uint8_t render_buf[64 * 1024 - 1];
 
 int
-LLVMFuzzerInitialize(int *argc __attribute__((unused)),
-                    char ***argv __attribute__((unused))) {
+LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_UNUSED) {
        isc_mem_create(&mctx);
        output = isc_mem_get(mctx, output_len);
 
index ba9c7ab2a21f9d5caf962b8307bca0d2bbc7d4d6..437496e5ce89b3faad393f896a43071cd33f97de 100644 (file)
@@ -25,8 +25,7 @@
 bool debug = false;
 
 int
-LLVMFuzzerInitialize(int *argc __attribute__((unused)),
-                    char ***argv __attribute__((unused))) {
+LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_UNUSED) {
        return (0);
 }
 
index 6fd02a51e763761d95918783c8fb03ffc96c217a..e6ad89a577002a5ebc79f1f20d3c9067a3f724c7 100644 (file)
@@ -29,8 +29,7 @@
 bool debug = false;
 
 int
-LLVMFuzzerInitialize(int *argc __attribute__((unused)),
-                    char ***argv __attribute__((unused))) {
+LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_UNUSED) {
        return (0);
 }
 
index dee7d002825a2378759a93c8e2802fad7f2f4167..c559849f7796fa3b3d50928e45feed137c6e47d4 100644 (file)
@@ -42,8 +42,7 @@ static isc_mem_t *mctx = NULL;
 static isc_lex_t *lex = NULL;
 
 int
-LLVMFuzzerInitialize(int *argc __attribute__((unused)),
-                    char ***argv __attribute__((unused))) {
+LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_UNUSED) {
        isc_lexspecials_t specials;
 
        isc_mem_create(&mctx);
index 769f8468154e23836b90427a183e19be1ca0b98f..49ad08fd6e61e1807d51977dcaffe9a37293d568 100644 (file)
@@ -31,8 +31,7 @@ ISC_LANG_BEGINDECLS
 extern bool debug;
 
 int
-LLVMFuzzerInitialize(int *argc __attribute__((unused)),
-                    char ***argv __attribute__((unused)));
+LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_UNUSED);
 
 int
 LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
index 1967bfb4932089dbb3a52fa66432782f0348cd03..3dc8f558f1a2b131b28410dbb6dde1f861872c19 100644 (file)
@@ -25,8 +25,7 @@
 bool debug = false;
 
 int
-LLVMFuzzerInitialize(int *argc __attribute__((unused)),
-                    char ***argv __attribute__((unused)));
+LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_UNUSED);
 
 int
 LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
@@ -35,8 +34,7 @@ static isc_mem_t *mctx = NULL;
 static isc_lex_t *lex = NULL;
 
 int
-LLVMFuzzerInitialize(int *argc __attribute__((unused)),
-                    char ***argv __attribute__((unused))) {
+LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_UNUSED) {
        isc_mem_create(&mctx);
        isc_lex_create(mctx, 1024, &lex);
 
index c98d5138e2a6613d2779ab0680ff76a78518cd16..94d60f952b4ce97126ff6541bc4645b5a8899219 100644 (file)
@@ -27,8 +27,7 @@ static isc_mem_t *mctx = NULL;
 static isc_lex_t *lex = NULL;
 
 int
-LLVMFuzzerInitialize(int *argc __attribute__((unused)),
-                    char ***argv __attribute__((unused))) {
+LLVMFuzzerInitialize(int *argc ISC_ATTR_UNUSED, char ***argv ISC_ATTR_UNUSED) {
        isc_mem_create(&mctx);
        isc_lex_create(mctx, 1024, &lex);
 
index 17b55e604f2987f08e140ab1f3a80dd4e36e405d..87d189afb853fb603f0bc6b5a1cd87e8d135773f 100644 (file)
@@ -215,7 +215,7 @@ typedef struct {
 } librpz_emsg_t;
 
 #ifdef LIBRPZ_HAVE_ATTR
-#define LIBRPZ_UNUSED  __attribute__((unused))
+#define LIBRPZ_UNUSED  ISC_ATTR_UNUSED
 #define LIBRPZ_PF(f, l) __attribute__((format(printf, f, l)))
 #define LIBRPZ_NORET   __attribute__((__noreturn__))
 #else /* ifdef LIBRPZ_HAVE_ATTR */
index f1a0b680c6af9cf368694cb5673ec9fe580206d3..e7326917a2d070bec7e1c10154d2f932a5dcac1a 100644 (file)
 
 #define DNS__DB_FILELINE   , __func__, __FILE__, __LINE__
 #define DNS__DB_FLARG_PASS , func, file, line
-#define DNS__DB_FLARG                                          \
-       , const char        *func __attribute__((__unused__)), \
-               const char  *file __attribute__((__unused__)), \
-               unsigned int line __attribute__((__unused__))
+#define DNS__DB_FLARG                                                         \
+       , const char *func ISC_ATTR_UNUSED, const char *file ISC_ATTR_UNUSED, \
+               unsigned int line ISC_ATTR_UNUSED
 
 #else /* DNS_DB_NODETRACE */
 
index 1a8f15e0a2957a89b2425a28a142b3df1277bb91..d5d8eb13bbc6b4ca16afcd70cb6977f0fdac5a89 100644 (file)
@@ -145,7 +145,7 @@ hashmap_node_init(hashmap_node_t *node, const uint32_t hashval,
        };
 }
 
-static void __attribute__((__unused__))
+ISC_ATTR_UNUSED static void
 hashmap_dump_table(const isc_hashmap_t *hashmap, const uint8_t idx) {
        fprintf(stderr,
                "====== %" PRIu8 " (bits = %" PRIu8 ", size = %zu =====\n", idx,
index 812f136c8ba839a054e9721b7ec5c3811a1e36bd..edb50ed8263cde876ece0630992924220828799b 100644 (file)
@@ -21,9 +21,7 @@
 #define __has_c_attribute(x) 0
 #endif /* if !defined(__has_c_attribute) */
 
-#if __has_c_attribute(noreturn)
-#define noreturn [[noreturn]]
-#elif defined(HAVE_STDNORETURN_H)
+#ifdef HAVE_STDNORETURN_H
 #include <stdnoreturn.h>
 #elif HAVE_FUNC_ATTRIBUTE_NORETURN
 #define noreturn __attribute__((noreturn))
index aa90e6f80a689cf2377a29cd918fef11e62c762c..944dccaabb836365274c08c3014da868a2e3389d 100644 (file)
@@ -153,10 +153,9 @@ isc_nmsocket_set_max_streams(isc_nmsocket_t *listener,
 #define isc_nmhandle_detach(handlep) \
        isc__nmhandle_detach(handlep, __FILE__, __LINE__, __func__)
 #define FLARG_PASS , file, line, func
-#define FLARG                                              \
-       , const char        *file __attribute__((unused)), \
-               unsigned int line __attribute__((unused)), \
-               const char  *func __attribute__((unused))
+#define FLARG                                                                  \
+       , const char *file ISC_ATTR_UNUSED, unsigned int line ISC_ATTR_UNUSED, \
+               const char *func ISC_ATTR_UNUSED
 #else
 #define isc_nmhandle_attach(handle, dest) isc__nmhandle_attach(handle, dest)
 #define isc_nmhandle_detach(handlep)     isc__nmhandle_detach(handlep)
index 9c5c5c50245908859606afa927680f5bc2f40f56..503c624aaf3bbc0051c1a03e00558b197cce4c1b 100644 (file)
  ***/
 
 /*%
- * Use this to hide unused function arguments.
+ * Legacy way how to hide unused function arguments, don't use in
+ * the new code, rather use the ISC_ATTR_UNUSED macro that expands
+ * to either C23's [[maybe_unused]] or __attribute__((__unused__)).
+ *
  * \code
  * int
- * foo(char *bar)
- * {
- *     UNUSED(bar);
+ * foo(ISC_ATTR_UNUSED char *bar) {
+ *         ...;
  * }
  * \endcode
  */
 #define ISC_NONSTRING
 #endif /* __GNUC__ */
 
-#if __has_c_attribute(fallthrough)
-#define FALLTHROUGH [[fallthrough]]
-#elif __GNUC__ >= 7 && !defined(__clang__)
-#define FALLTHROUGH __attribute__((fallthrough))
-#else
-/* clang-format off */
-#define FALLTHROUGH do {} while (0) /* FALLTHROUGH */
-/* clang-format on */
-#endif
-
 #if HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR && HAVE_FUNC_ATTRIBUTE_DESTRUCTOR
 #define ISC_CONSTRUCTOR __attribute__((constructor))
 #define ISC_DESTRUCTOR __attribute__((destructor))
index a852fefb429d34c7bbcbd68d6ca5813b20180038..eaf14f6637675570e38506d687b5aca4095943c1 100644 (file)
@@ -129,10 +129,9 @@ STATIC_ASSERT(ISC_NETMGR_TCP_RECVBUF_SIZE <= ISC_NETMGR_RECVBUF_SIZE,
        fprintf(stderr, "%" PRIu32 ":%d:%s:%u:%s:" format, gettid(), \
                isc_tid(), file, line, func, __VA_ARGS__)
 
-#define FLARG                                              \
-       , const char *file __attribute__((unused)),        \
-               unsigned int line __attribute__((unused)), \
-               const char *func __attribute__((unused))
+#define FLARG                                                                  \
+       , const char *file ISC_ATTR_UNUSED, unsigned int line ISC_ATTR_UNUSED, \
+               const char *func ISC_ATTR_UNUSED
 #define FLARG_PASS , file, line, func
 #define FLARG_IEVENT(ievent)              \
        const char *file = ievent->file;  \
index 162d5261ddd4d6a50a32d24c4057e2783aec2cd3..464a6788783780b4ffb8941e6f67fddd03e3889c 100644 (file)
@@ -374,13 +374,11 @@ isc_nm_getloadbalancesockets(isc_nm_t *mgr) {
 }
 
 void
-isc_nm_setloadbalancesockets(isc_nm_t *mgr, bool enabled) {
+isc_nm_setloadbalancesockets(isc_nm_t *mgr, ISC_ATTR_UNUSED bool enabled) {
        REQUIRE(VALID_NM(mgr));
 
 #if HAVE_SO_REUSEPORT_LB
        mgr->load_balance_sockets = enabled;
-#else
-       UNUSED(enabled);
 #endif
 }
 
index 1514674d3f0166308abdee1421bfc9ae0ad936c7..6aa054e0695a2c9bfd64bad02c587ef4a25fbc99 100644 (file)
@@ -44,7 +44,7 @@
 #define TAPTEXT         TESTS_DIR "/testdata/dnstap/dnstap.text"
 
 static int
-cleanup(void **state __attribute__((__unused__))) {
+cleanup(void **state ISC_ATTR_UNUSED) {
        (void)isc_file_remove(TAPFILE);
        (void)isc_file_remove(TAPSOCK);
 
index 70b7cbca2477e5c027947016cc3e60c8da80badb..18a28488534e472f06a88d3b35a587bb5ed26233 100644 (file)
@@ -191,7 +191,7 @@ ISC_LOOP_TEST_IMPL(asyncload_zone) {
 dns_zone_t *zone1 = NULL, *zone2 = NULL, *zone3 = NULL;
 
 static isc_result_t
-all_done(void *arg __attribute__((__unused__))) {
+all_done(void *arg ISC_ATTR_UNUSED) {
        isc_result_t result;
 
        /* Both zones should now be loaded; test them */
index 8d51f22bbbb084c7cfaaaf5f39b9b507fe551a94..391a64454becfea6aea47c7dbadcc90a3c0132ee 100644 (file)
@@ -76,17 +76,17 @@ teardown_managers(void **state);
 /* clang-format on */
 
 #define ISC_SETUP_TEST_DECLARE(name) \
-       int setup_test_##name(void **state __attribute__((unused)));
+       int setup_test_##name(void **state ISC_ATTR_UNUSED);
 
 #define ISC_RUN_TEST_DECLARE(name) \
-       void run_test_##name(void **state __attribute__((unused)));
+       void run_test_##name(void **state ISC_ATTR_UNUSED);
 
 #define ISC_TEARDOWN_TEST_DECLARE(name) \
-       int teardown_test_##name(void **state __attribute__((unused)))
+       int teardown_test_##name(void **state ISC_ATTR_UNUSED)
 
-#define ISC_LOOP_TEST_CUSTOM_DECLARE(name, setup, teardown)             \
-       void run_test_##name(void **state __attribute__((__unused__))); \
-       void loop_test_##name(void *arg __attribute__((__unused__)));
+#define ISC_LOOP_TEST_CUSTOM_DECLARE(name, setup, teardown) \
+       void run_test_##name(void **state ISC_ATTR_UNUSED); \
+       void loop_test_##name(void *arg ISC_ATTR_UNUSED);
 
 #define ISC_LOOP_TEST_DECLARE(name) \
        ISC_LOOP_TEST_CUSTOM_DECLARE(name, NULL, NULL)
@@ -102,41 +102,41 @@ teardown_managers(void **state);
        ISC_LOOP_TEST_CUSTOM_DECLARE(name, NULL, teardown_loop_##name)
 
 #define ISC_LOOP_SETUP_DECLARE(name) \
-       void setup_loop_##name(void *arg __attribute__((__unused__)));
+       void setup_loop_##name(void *arg ISC_ATTR_UNUSED);
 
-#define ISC_SETUP_TEST_IMPL(name)                                    \
-       int setup_test_##name(void **state __attribute__((unused))); \
-       int setup_test_##name(void **state __attribute__((unused)))
+#define ISC_SETUP_TEST_IMPL(name)                            \
+       int setup_test_##name(void **state ISC_ATTR_UNUSED); \
+       int setup_test_##name(void **state ISC_ATTR_UNUSED)
 
-#define ISC_RUN_TEST_IMPL(name)                                     \
-       void run_test_##name(void **state __attribute__((unused))); \
-       void run_test_##name(void **state __attribute__((unused)))
+#define ISC_RUN_TEST_IMPL(name)                             \
+       void run_test_##name(void **state ISC_ATTR_UNUSED); \
+       void run_test_##name(void **state ISC_ATTR_UNUSED)
 
-#define ISC_TEARDOWN_TEST_IMPL(name)                                    \
-       int teardown_test_##name(void **state __attribute__((unused))); \
-       int teardown_test_##name(void **state __attribute__((unused)))
+#define ISC_TEARDOWN_TEST_IMPL(name)                            \
+       int teardown_test_##name(void **state ISC_ATTR_UNUSED); \
+       int teardown_test_##name(void **state ISC_ATTR_UNUSED)
 
 #define ISC_TEST_LIST_START const struct CMUnitTest tests[] = {
 #define ISC_TEST_LIST_END \
        }                 \
        ;
 
-#define ISC_LOOP_TEST_CUSTOM_IMPL(name, setup, teardown)                 \
-       void run_test_##name(void **state __attribute__((__unused__)));  \
-       void loop_test_##name(void *arg __attribute__((__unused__)));    \
-       void run_test_##name(void **state __attribute__((__unused__))) { \
-               isc_job_cb setup_loop = setup;                           \
-               isc_job_cb teardown_loop = teardown;                     \
-               if (setup_loop != NULL) {                                \
-                       setup_loop(state);                               \
-               }                                                        \
-               isc_loop_setup(mainloop, loop_test_##name, state);       \
-               isc_loopmgr_run(loopmgr);                                \
-               if (teardown_loop != NULL) {                             \
-                       teardown_loop(state);                            \
-               }                                                        \
-       }                                                                \
-       void loop_test_##name(void *arg __attribute__((__unused__)))
+#define ISC_LOOP_TEST_CUSTOM_IMPL(name, setup, teardown)           \
+       void run_test_##name(void **state ISC_ATTR_UNUSED);        \
+       void loop_test_##name(void *arg ISC_ATTR_UNUSED);          \
+       void run_test_##name(void **state ISC_ATTR_UNUSED) {       \
+               isc_job_cb setup_loop = setup;                     \
+               isc_job_cb teardown_loop = teardown;               \
+               if (setup_loop != NULL) {                          \
+                       setup_loop(state);                         \
+               }                                                  \
+               isc_loop_setup(mainloop, loop_test_##name, state); \
+               isc_loopmgr_run(loopmgr);                          \
+               if (teardown_loop != NULL) {                       \
+                       teardown_loop(state);                      \
+               }                                                  \
+       }                                                          \
+       void loop_test_##name(void *arg ISC_ATTR_UNUSED)
 
 #define ISC_LOOP_TEST_IMPL(name) ISC_LOOP_TEST_CUSTOM_IMPL(name, NULL, NULL)
 
@@ -149,13 +149,13 @@ teardown_managers(void **state);
 #define ISC_LOOP_TEST_TEARDOWN_IMPL(name) \
        ISC_LOOP_TEST_CUSTOM_IMPL(name, NULL, teardown_loop_##name)
 
-#define ISC_LOOP_SETUP_IMPL(name)                                      \
-       void setup_loop_##name(void *arg __attribute__((__unused__))); \
-       void setup_loop_##name(void *arg __attribute__((__unused__)))
+#define ISC_LOOP_SETUP_IMPL(name)                          \
+       void setup_loop_##name(void *arg ISC_ATTR_UNUSED); \
+       void setup_loop_##name(void *arg ISC_ATTR_UNUSED)
 
-#define ISC_LOOP_TEARDOWN_IMPL(name)                                      \
-       void teardown_loop_##name(void *arg __attribute__((__unused__))); \
-       void teardown_loop_##name(void *arg __attribute__((__unused__)))
+#define ISC_LOOP_TEARDOWN_IMPL(name)                          \
+       void teardown_loop_##name(void *arg ISC_ATTR_UNUSED); \
+       void teardown_loop_##name(void *arg ISC_ATTR_UNUSED)
 
 #define ISC_TEST_DECLARE(name) void run_test_##name(void **state);
 
index 90e2cf180ed7110b62480ef93bacb1f895690798..8661d1d8ddd8a52bdd50d22f128bc2dd62ad5815 100644 (file)
@@ -54,10 +54,9 @@ extern atomic_uint_fast32_t client_refs[32];
 extern atomic_uintptr_t            client_addrs[32];
 
 #if ISC_NETMGR_TRACE
-#define FLARG                                              \
-       , const char        *file __attribute__((unused)), \
-               unsigned int line __attribute__((unused)), \
-               const char  *func __attribute__((unused))
+#define FLARG                                                                  \
+       , const char *file ISC_ATTR_UNUSED, unsigned int line ISC_ATTR_UNUSED, \
+               const char *func ISC_ATTR_UNUSED
 #else
 #define FLARG
 #endif
@@ -67,7 +66,7 @@ setup_server(void **state);
 int
 teardown_server(void **state);
 void
-shutdown_interfacemgr(void *arg __attribute__((unused)));
+shutdown_interfacemgr(void *arg ISC_ATTR_UNUSED);
 
 /*%
  * Load data for zone "zonename" from file "filename" and start serving it to
index 43c0f98191ef2828612b9011b96d37bd059a2229..bb19298df90982fe3d8fd505560594af1a659927 100644 (file)
@@ -35,6 +35,7 @@
 #include <isc/refcount.h>
 #include <isc/sockaddr.h>
 #include <isc/thread.h>
+#include <isc/util.h>
 #include <isc/uv.h>
 
 #include "uv_wrap.h"
@@ -335,7 +336,7 @@ setup_test(void **state) {
 }
 
 static int
-teardown_test(void **state __attribute__((__unused__))) {
+teardown_test(void **state ISC_ATTR_UNUSED) {
        for (size_t i = 0; i < MAX_NM; i++) {
                isc_netmgr_destroy(&nm[i]);
                assert_null(nm[i]);
@@ -483,7 +484,7 @@ listen_sock_close(void *arg) {
 }
 
 static void
-doh_noop(void *arg __attribute__((__unused__))) {
+doh_noop(void *arg ISC_ATTR_UNUSED) {
        isc_nm_t *listen_nm = nm[0];
        isc_nm_t *connect_nm = nm[1];
        isc_result_t result = ISC_R_SUCCESS;
@@ -526,7 +527,7 @@ ISC_LOOP_TEST_IMPL(doh_noop_GET) {
 }
 
 static void
-doh_noresponse(void *arg __attribute__((__unused__))) {
+doh_noresponse(void *arg ISC_ATTR_UNUSED) {
        isc_nm_t *listen_nm = nm[0];
        isc_nm_t *connect_nm = nm[1];
        isc_result_t result = ISC_R_SUCCESS;
@@ -580,8 +581,8 @@ timeout_query_sent_cb(isc_nmhandle_t *handle, isc_result_t eresult,
 
 static void
 timeout_retry_cb(isc_nmhandle_t *handle, isc_result_t eresult,
-                isc_region_t *region __attribute__((__unused__)),
-                void *arg __attribute__((__unused__))) {
+                isc_region_t *region ISC_ATTR_UNUSED,
+                void *arg ISC_ATTR_UNUSED) {
        assert_non_null(handle);
 
        atomic_fetch_add(&ctimeouts, 1);
@@ -617,7 +618,7 @@ timeout_request_cb(isc_nmhandle_t *handle, isc_result_t result, void *arg) {
 }
 
 static void
-doh_timeout_recovery(void *arg __attribute__((__unused__))) {
+doh_timeout_recovery(void *arg ISC_ATTR_UNUSED) {
        isc_nm_t *listen_nm = nm[0];
        isc_nmsocket_t *listen_sock = NULL;
        isc_nm_t *connect_nm = nm[1];
@@ -740,7 +741,7 @@ next : {}
 }
 
 static void
-doh_recv_one(void *arg __attribute__((__unused__))) {
+doh_recv_one(void *arg ISC_ATTR_UNUSED) {
        isc_nm_t *listen_nm = nm[0];
        isc_nm_t *connect_nm = nm[1];
        isc_result_t result = ISC_R_SUCCESS;
@@ -866,7 +867,7 @@ doh_connect_send_two_requests_cb(isc_nmhandle_t *handle, isc_result_t result,
 }
 
 static void
-doh_recv_two(void *arg __attribute__((__unused__))) {
+doh_recv_two(void *arg ISC_ATTR_UNUSED) {
        isc_nm_t *listen_nm = nm[0];
        isc_nm_t *connect_nm = nm[1];
        isc_result_t result = ISC_R_SUCCESS;
@@ -969,7 +970,7 @@ ISC_LOOP_TEST_IMPL(doh_recv_two_GET_TLS_quota) {
 }
 
 static void
-doh_recv_send(void *arg __attribute__((__unused__))) {
+doh_recv_send(void *arg ISC_ATTR_UNUSED) {
        isc_nm_t *listen_nm = nm[0];
        isc_nm_t *connect_nm = nm[1];
        isc_result_t result = ISC_R_SUCCESS;
index ac567d68846bf70c003bd527b9455e25a05ae564..89e23a6291fdcf62b02d3277571561e828b80ecc 100644 (file)
@@ -166,8 +166,8 @@ ISC_RUN_TEST_IMPL(isc_hmac_update) {
 ISC_RUN_TEST_IMPL(isc_hmac_reset) {
        isc_hmac_t *hmac = *state;
 #if 0
-       unsigned char digest[ISC_MAX_MD_SIZE] __attribute((unused));
-       unsigned int digestlen __attribute((unused));
+       unsigned char digest[ISC_MAX_MD_SIZE] ISC_ATTR_UNUSED;
+       unsigned int digestlen ISC_ATTR_UNUSED;
 #endif /* if 0 */
 
        assert_non_null(hmac);
index cf13a4a586dc8370e74391835fa4772e1a459dfd..b7acad42244a9ed2830ed831ac95a181394c1e2f 100644 (file)
@@ -65,9 +65,8 @@ ISC_RUN_TEST_IMPL(isc_loopmgr) {
 }
 
 static void
-runjob(void *arg __attribute__((__unused__))) {
+runjob(void *arg ISC_ATTR_UNUSED) {
        isc_async_current(loopmgr, count, loopmgr);
-
        if (isc_tid() == 0) {
                isc_async_current(loopmgr, shutdown_loopmgr, loopmgr);
        }
index d7d154c13b18eaa59a31488bc130b53ade7845d0..446367fc3bebca943b40aac5f091b80029068de6 100644 (file)
@@ -151,8 +151,8 @@ ISC_RUN_TEST_IMPL(isc_md_update) {
 ISC_RUN_TEST_IMPL(isc_md_reset) {
        isc_md_t *md = *state;
 #if 0
-       unsigned char digest[ISC_MAX_MD_SIZE] __attribute((unused));
-       unsigned int digestlen __attribute((unused));
+       unsigned char digest[ISC_MAX_MD_SIZE] ISC_ATTR_UNUSED;
+       unsigned int digestlen ISC_ATTR_UNUSED;
 #endif /* if 0 */
 
        assert_non_null(md);
index 62bd912a1f710b3c4b974ec94b7094e031fd99d0..b8988b9154bf5484fe227c80880ea75ca4f8031e 100644 (file)
@@ -195,7 +195,7 @@ setup_netmgr_test(void **state) {
 }
 
 int
-teardown_netmgr_test(void **state __attribute__((__unused__))) {
+teardown_netmgr_test(void **state ISC_ATTR_UNUSED) {
        UNUSED(state);
 
        isc_tlsctx_client_session_cache_detach(&tcp_tlsctx_client_sess_cache);
@@ -221,7 +221,7 @@ teardown_netmgr_test(void **state __attribute__((__unused__))) {
 }
 
 static void
-stop_listening(void *arg __attribute__((__unused__))) {
+stop_listening(void *arg ISC_ATTR_UNUSED) {
        isc_nm_stoplistening(listen_sock);
        isc_nmsocket_close(&listen_sock);
        assert_null(listen_sock);
@@ -628,14 +628,14 @@ connect_success_cb(isc_nmhandle_t *handle, isc_result_t eresult, void *cbarg) {
 }
 
 int
-stream_noop_setup(void **state __attribute__((__unused__))) {
+stream_noop_setup(void **state ISC_ATTR_UNUSED) {
        int r = setup_netmgr_test(state);
        expected_cconnects = 1;
        return (r);
 }
 
 void
-stream_noop(void **state __attribute__((__unused__))) {
+stream_noop(void **state ISC_ATTR_UNUSED) {
        isc_result_t result = ISC_R_SUCCESS;
 
        result = stream_listen(noop_accept_cb, NULL, 128, NULL, &listen_sock);
@@ -647,7 +647,7 @@ stream_noop(void **state __attribute__((__unused__))) {
 }
 
 int
-stream_noop_teardown(void **state __attribute__((__unused__))) {
+stream_noop_teardown(void **state ISC_ATTR_UNUSED) {
        atomic_assert_int_eq(cconnects, 1);
        atomic_assert_int_eq(csends, 0);
        atomic_assert_int_eq(creads, 0);
@@ -713,7 +713,7 @@ noresponse_connectcb(isc_nmhandle_t *handle, isc_result_t eresult,
 }
 
 int
-stream_noresponse_setup(void **state __attribute__((__unused__))) {
+stream_noresponse_setup(void **state ISC_ATTR_UNUSED) {
        int r = setup_netmgr_test(state);
        expected_cconnects = 1;
        expected_saccepts = 1;
@@ -721,7 +721,7 @@ stream_noresponse_setup(void **state __attribute__((__unused__))) {
 }
 
 void
-stream_noresponse(void **state __attribute__((__unused__))) {
+stream_noresponse(void **state ISC_ATTR_UNUSED) {
        isc_result_t result = ISC_R_SUCCESS;
 
        result = stream_listen(noop_accept_cb, NULL, 128, NULL, &listen_sock);
@@ -732,7 +732,7 @@ stream_noresponse(void **state __attribute__((__unused__))) {
 }
 
 int
-stream_noresponse_teardown(void **state __attribute__((__unused__))) {
+stream_noresponse_teardown(void **state ISC_ATTR_UNUSED) {
        X(cconnects);
        X(csends);
        X(creads);
@@ -748,7 +748,7 @@ stream_noresponse_teardown(void **state __attribute__((__unused__))) {
 }
 
 int
-stream_timeout_recovery_setup(void **state __attribute__((__unused__))) {
+stream_timeout_recovery_setup(void **state ISC_ATTR_UNUSED) {
        int r = setup_netmgr_test(state);
 
        expected_ctimeouts = 4;
@@ -761,7 +761,7 @@ stream_timeout_recovery_setup(void **state __attribute__((__unused__))) {
 }
 
 void
-stream_timeout_recovery(void **state __attribute__((__unused__))) {
+stream_timeout_recovery(void **state ISC_ATTR_UNUSED) {
        isc_result_t result = ISC_R_SUCCESS;
 
        /*
@@ -782,13 +782,13 @@ stream_timeout_recovery(void **state __attribute__((__unused__))) {
 }
 
 int
-stream_timeout_recovery_teardown(void **state __attribute__((__unused__))) {
+stream_timeout_recovery_teardown(void **state ISC_ATTR_UNUSED) {
        atomic_assert_int_eq(ctimeouts, expected_ctimeouts);
        return (teardown_netmgr_test(state));
 }
 
 int
-stream_recv_one_setup(void **state __attribute__((__unused__))) {
+stream_recv_one_setup(void **state ISC_ATTR_UNUSED) {
        int r = setup_netmgr_test(state);
 
        expected_cconnects = 1;
@@ -813,7 +813,7 @@ stream_recv_one_setup(void **state __attribute__((__unused__))) {
 }
 
 void
-stream_recv_one(void **state __attribute__((__unused__))) {
+stream_recv_one(void **state ISC_ATTR_UNUSED) {
        isc_result_t result = ISC_R_SUCCESS;
        isc_quota_t *quotap = tcp_listener_init_quota(1);
 
@@ -828,7 +828,7 @@ stream_recv_one(void **state __attribute__((__unused__))) {
 }
 
 int
-stream_recv_one_teardown(void **state __attribute__((__unused__))) {
+stream_recv_one_teardown(void **state ISC_ATTR_UNUSED) {
        atomic_assert_int_eq(cconnects, expected_cconnects);
        atomic_assert_int_eq(csends, expected_csends);
        atomic_assert_int_eq(saccepts, expected_saccepts);
@@ -840,7 +840,7 @@ stream_recv_one_teardown(void **state __attribute__((__unused__))) {
 }
 
 int
-stream_recv_two_setup(void **state __attribute__((__unused__))) {
+stream_recv_two_setup(void **state ISC_ATTR_UNUSED) {
        int r = setup_netmgr_test(state);
 
        expected_cconnects = 2;
@@ -865,7 +865,7 @@ stream_recv_two_setup(void **state __attribute__((__unused__))) {
 }
 
 void
-stream_recv_two(void **state __attribute__((__unused__))) {
+stream_recv_two(void **state ISC_ATTR_UNUSED) {
        isc_result_t result = ISC_R_SUCCESS;
        isc_quota_t *quotap = tcp_listener_init_quota(1);
 
@@ -882,7 +882,7 @@ stream_recv_two(void **state __attribute__((__unused__))) {
 }
 
 int
-stream_recv_two_teardown(void **state __attribute__((__unused__))) {
+stream_recv_two_teardown(void **state ISC_ATTR_UNUSED) {
        atomic_assert_int_eq(cconnects, expected_cconnects);
        atomic_assert_int_eq(csends, expected_csends);
        atomic_assert_int_eq(sreads, expected_saccepts);
@@ -894,7 +894,7 @@ stream_recv_two_teardown(void **state __attribute__((__unused__))) {
 }
 
 int
-stream_recv_send_setup(void **state __attribute__((__unused__))) {
+stream_recv_send_setup(void **state ISC_ATTR_UNUSED) {
        int r = setup_netmgr_test(state);
        expected_cconnects = workers;
        cconnects_shutdown = false;
@@ -905,7 +905,7 @@ stream_recv_send_setup(void **state __attribute__((__unused__))) {
 }
 
 void
-stream_recv_send(void **state __attribute__((__unused__))) {
+stream_recv_send(void **state ISC_ATTR_UNUSED) {
        isc_result_t result = ISC_R_SUCCESS;
        isc_quota_t *quotap = tcp_listener_init_quota(workers);
 
@@ -922,7 +922,7 @@ stream_recv_send(void **state __attribute__((__unused__))) {
 }
 
 int
-stream_recv_send_teardown(void **state __attribute__((__unused__))) {
+stream_recv_send_teardown(void **state ISC_ATTR_UNUSED) {
        X(cconnects);
        X(csends);
        X(creads);
index 31d63f3fc9e3a2cc8f4c41ca5fc8fd9eebbfe1b8..3ff3f62fef1f3d03f3a63a2c2908ddd4b7adc6ea 100644 (file)
@@ -15,6 +15,7 @@
 #include <isc/netmgr.h>
 #include <isc/refcount.h>
 #include <isc/thread.h>
+#include <isc/util.h>
 
 #include "netmgr/netmgr-int.h"
 
@@ -227,7 +228,7 @@ extern isc_nm_recv_cb_t connect_readcb;
 int
 setup_netmgr_test(void **state);
 int
-teardown_netmgr_test(void **state __attribute__((unused)));
+teardown_netmgr_test(void **state ISC_ATTR_UNUSED);
 
 void
 noop_recv_cb(isc_nmhandle_t *handle, isc_result_t eresult, isc_region_t *region,
@@ -282,45 +283,45 @@ void
 stream_connect(isc_nm_cb_t cb, void *cbarg, unsigned int timeout);
 
 int
-stream_noop_setup(void **state __attribute__((unused)));
+stream_noop_setup(void **state ISC_ATTR_UNUSED);
 void
-stream_noop(void **state __attribute__((unused)));
+stream_noop(void **state ISC_ATTR_UNUSED);
 int
-stream_noop_teardown(void **state __attribute__((unused)));
+stream_noop_teardown(void **state ISC_ATTR_UNUSED);
 
 int
-stream_noresponse_setup(void **state __attribute__((unused)));
+stream_noresponse_setup(void **state ISC_ATTR_UNUSED);
 void
-stream_noresponse(void **state __attribute__((unused)));
+stream_noresponse(void **state ISC_ATTR_UNUSED);
 int
-stream_noresponse_teardown(void **state __attribute__((unused)));
+stream_noresponse_teardown(void **state ISC_ATTR_UNUSED);
 
 int
-stream_timeout_recovery_setup(void **state __attribute__((unused)));
+stream_timeout_recovery_setup(void **state ISC_ATTR_UNUSED);
 void
-stream_timeout_recovery(void **state __attribute__((unused)));
+stream_timeout_recovery(void **state ISC_ATTR_UNUSED);
 int
-stream_timeout_recovery_teardown(void **state __attribute__((unused)));
+stream_timeout_recovery_teardown(void **state ISC_ATTR_UNUSED);
 
 int
-stream_recv_one_setup(void **state __attribute__((unused)));
+stream_recv_one_setup(void **state ISC_ATTR_UNUSED);
 void
-stream_recv_one(void **state __attribute__((unused)));
+stream_recv_one(void **state ISC_ATTR_UNUSED);
 int
-stream_recv_one_teardown(void **state __attribute__((unused)));
+stream_recv_one_teardown(void **state ISC_ATTR_UNUSED);
 
 int
-stream_recv_two_setup(void **state __attribute__((unused)));
+stream_recv_two_setup(void **state ISC_ATTR_UNUSED);
 void
-stream_recv_two(void **state __attribute__((unused)));
+stream_recv_two(void **state ISC_ATTR_UNUSED);
 int
-stream_recv_two_teardown(void **state __attribute__((unused)));
+stream_recv_two_teardown(void **state ISC_ATTR_UNUSED);
 
 int
-stream_recv_send_setup(void **state __attribute__((unused)));
+stream_recv_send_setup(void **state ISC_ATTR_UNUSED);
 void
-stream_recv_send(void **state __attribute__((unused)));
+stream_recv_send(void **state ISC_ATTR_UNUSED);
 int
-stream_recv_send_teardown(void **state __attribute__((unused)));
+stream_recv_send_teardown(void **state ISC_ATTR_UNUSED);
 void
 stream_recv_send_connect(void *arg);
index b76394fa6f0b0f143c3e5a8cda1e611c1d4a3b4d..1095fb66e0a38534969ec6547614176fa0633fbd 100644 (file)
@@ -131,7 +131,7 @@ ISC_TEST_ENTRY_CUSTOM(tcp_recv_send_quota_sendback, stream_recv_send_setup,
 ISC_TEST_LIST_END
 
 static int
-tcp_setup(void **state __attribute__((__unused__))) {
+tcp_setup(void **state ISC_ATTR_UNUSED) {
        stream_port = TCP_TEST_PORT;
        stream_use_TLS = false;
        stream = true;
index 4747f4ad20a9e9d70883f5e98be5be0d37cfeb2e..7006add141b78e6aa8e1624ddae87c56e64a2954 100644 (file)
@@ -41,7 +41,7 @@
 /* TCPDNS */
 
 static void
-stop_listening(void *arg __attribute__((__unused__))) {
+stop_listening(void *arg ISC_ATTR_UNUSED) {
        isc_nm_stoplistening(listen_sock);
        isc_nmsocket_close(&listen_sock);
        assert_null(listen_sock);
@@ -143,7 +143,7 @@ ISC_TEST_ENTRY_CUSTOM(tcpdns_recv_send, stream_recv_send_setup,
 ISC_TEST_LIST_END
 
 static int
-tcpdns_setup(void **state __attribute__((__unused__))) {
+tcpdns_setup(void **state ISC_ATTR_UNUSED) {
        stream_port = TCPDNS_TEST_PORT;
 
        return (0);
index cd9412e648178d5c00f1a2593556c0d65f170e15..ba6805619644429d736658720691613d3242cb18 100644 (file)
@@ -427,7 +427,7 @@ ISC_LOOP_TEARDOWN_IMPL(timer_expect) {
 }
 
 static void
-timer_event(void *arg __attribute__((__unused__))) {
+timer_event(void *arg ISC_ATTR_UNUSED) {
        if (--timer_ticks == 0) {
                isc_timer_destroy(&timer);
                isc_loopmgr_shutdown(loopmgr);
index 200fc2adfdeee0526c0b17970c2ba336dc105a1b..6ba6269336259237b90031e2a41611aea9e3096c 100644 (file)
@@ -126,7 +126,7 @@ ISC_TEST_ENTRY_CUSTOM(tls_recv_send_quota_sendback, stream_recv_send_setup,
 ISC_TEST_LIST_END
 
 static int
-tls_setup(void **state __attribute__((__unused__))) {
+tls_setup(void **state ISC_ATTR_UNUSED) {
        stream_port = TLS_TEST_PORT;
        stream_use_TLS = true;
        stream = true;
index b33496ba7d4121256f2b3d9ccdb08edf74944605..e42be5e6bba00ebf204f7c4cedda056f0b177d9b 100644 (file)
@@ -40,7 +40,7 @@
 #include <tests/isc.h>
 
 static void
-stop_listening(void *arg __attribute__((__unused__))) {
+stop_listening(void *arg ISC_ATTR_UNUSED) {
        isc_nm_stoplistening(listen_sock);
        isc_nmsocket_close(&listen_sock);
        assert_null(listen_sock);
@@ -153,7 +153,7 @@ ISC_TEST_ENTRY_CUSTOM(tlsdns_recv_send, stream_recv_send_setup,
 ISC_TEST_LIST_END
 
 static int
-tlsdns_setup(void **state __attribute__((__unused__))) {
+tlsdns_setup(void **state ISC_ATTR_UNUSED) {
        stream_port = TLSDNS_TEST_PORT;
 
        return (0);
index 17221a1fb989dbc84faa4caa7ce5d9699aafbfc9..ab6742d77b93d439c979e0c38105d245ee656ea5 100644 (file)
@@ -139,7 +139,7 @@ connect_nomemory_cb(isc_nmhandle_t *handle, isc_result_t eresult, void *cbarg) {
 }
 
 static void
-stop_listening(void *arg __attribute__((__unused__))) {
+stop_listening(void *arg ISC_ATTR_UNUSED) {
        isc_nm_stoplistening(listen_sock);
        isc_nmsocket_close(&listen_sock);
        assert_null(listen_sock);
@@ -520,7 +520,7 @@ udp_shutdown_connect_connect_cb(isc_nmhandle_t *handle, isc_result_t eresult,
 }
 
 static void
-udp_connect_udpconnect(void *arg __attribute__((__unused__))) {
+udp_connect_udpconnect(void *arg ISC_ATTR_UNUSED) {
        isc_nm_udpconnect(netmgr, &udp_connect_addr, &udp_listen_addr,
                          udp_shutdown_connect_connect_cb, NULL, T_SOFT);
 }
@@ -790,7 +790,7 @@ udp__send_cb(isc_nmhandle_t *handle, isc_result_t eresult, void *cbarg) {
 static void
 udp__connect_cb(isc_nmhandle_t *handle, isc_result_t eresult, void *cbarg);
 static void
-udp__connect(void *arg __attribute__((__unused__))) {
+udp__connect(void *arg ISC_ATTR_UNUSED) {
        isc_sockaddr_t connect_addr;
 
        connect_addr = (isc_sockaddr_t){ .length = 0 };
index 8a6f7598ff2499c9258992a8c49f49e7b19b409a..c499fa6db96658d535156f4bd1d7f72769aa3ceb 100644 (file)
@@ -25,6 +25,7 @@
 #include <unistd.h>
 
 #include <isc/atomic.h>
+#include <isc/util.h>
 
 #define UNIT_TESTING
 #include <cmocka.h>
@@ -114,7 +115,7 @@ __wrap_uv_udp_bind(uv_udp_t *handle, const struct sockaddr *addr,
        return (atomic_load(&__state_uv_udp_bind));
 }
 
-static atomic_int __state_uv_udp_connect __attribute__((unused)) = 0;
+static atomic_int __state_uv_udp_connect ISC_ATTR_UNUSED = 0;
 
 int
 __wrap_uv_udp_connect(uv_udp_t *handle, const struct sockaddr *addr) {
@@ -124,7 +125,7 @@ __wrap_uv_udp_connect(uv_udp_t *handle, const struct sockaddr *addr) {
        return (atomic_load(&__state_uv_udp_connect));
 }
 
-static atomic_int __state_uv_udp_getpeername __attribute__((unused)) = 0;
+static atomic_int __state_uv_udp_getpeername ISC_ATTR_UNUSED = 0;
 
 int
 __wrap_uv_udp_getpeername(const uv_udp_t *handle, struct sockaddr *name,
index d9da8e2e610ffedd52d1f834a16fa22a8396040d..bc542a7f1fa2f026355e3c34617c79908e04433d 100644 (file)
@@ -52,7 +52,7 @@ adjustnofile(void) {
 }
 
 int
-setup_mctx(void **state __attribute__((__unused__))) {
+setup_mctx(void **state ISC_ATTR_UNUSED) {
        isc_mem_debugging |= ISC_MEM_DEBUGRECORD;
        isc_mem_create(&mctx);
 
@@ -60,14 +60,14 @@ setup_mctx(void **state __attribute__((__unused__))) {
 }
 
 int
-teardown_mctx(void **state __attribute__((__unused__))) {
+teardown_mctx(void **state ISC_ATTR_UNUSED) {
        isc_mem_destroy(&mctx);
 
        return (0);
 }
 
 int
-setup_loopmgr(void **state __attribute__((__unused__))) {
+setup_loopmgr(void **state ISC_ATTR_UNUSED) {
        char *env_workers = NULL;
 
        REQUIRE(mctx != NULL);
@@ -88,7 +88,7 @@ setup_loopmgr(void **state __attribute__((__unused__))) {
 }
 
 int
-teardown_loopmgr(void **state __attribute__((__unused__))) {
+teardown_loopmgr(void **state ISC_ATTR_UNUSED) {
        REQUIRE(netmgr == NULL);
 
        mainloop = NULL;
@@ -98,7 +98,7 @@ teardown_loopmgr(void **state __attribute__((__unused__))) {
 }
 
 int
-setup_netmgr(void **state __attribute__((__unused__))) {
+setup_netmgr(void **state ISC_ATTR_UNUSED) {
        REQUIRE(loopmgr != NULL);
 
        adjustnofile();
@@ -109,7 +109,7 @@ setup_netmgr(void **state __attribute__((__unused__))) {
 }
 
 int
-teardown_netmgr(void **state __attribute__((__unused__))) {
+teardown_netmgr(void **state ISC_ATTR_UNUSED) {
        REQUIRE(loopmgr != NULL);
 
        isc_netmgr_destroy(&netmgr);
index 4e450c86ddf53aaf1d20a0037f140ca41c864f54..4d9014ae17c80c7d8d7f65e0c65d31de8f789816 100644 (file)
@@ -115,7 +115,7 @@ cleanup:
 }
 
 void
-shutdown_interfacemgr(void *arg __attribute__((__unused__))) {
+shutdown_interfacemgr(void *arg ISC_ATTR_UNUSED) {
        if (interfacemgr != NULL) {
                ns_interfacemgr_shutdown(interfacemgr);
                ns_interfacemgr_detach(&interfacemgr);
index e347b0612ab690fa83c34d0b3077f45d38509d05..ef5b7dd4c189c5e58aed3677bdf7f5b8c21ce86e 100644 (file)
 #include <ns/client.h>
 
 #if ISC_NETMGR_TRACE
-#define FLARG                                              \
-       , const char *file __attribute__((unused)),        \
-               unsigned int line __attribute__((unused)), \
-               const char *func __attribute__((unused))
+#define FLARG                                                                  \
+       , const char *file ISC_ATTR_UNUSED, unsigned int line ISC_ATTR_UNUSED, \
+               const char *func ISC_ATTR_UNUSED
 #else
 #define FLARG
 #endif