Replace __attribute__((unused)) with ISC_ATTR_UNUSED attribute macro

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.
This commit is contained in:
Ondřej Surý
2023-01-10 10:20:44 +01:00
parent 1176bf0552
commit 2c0a9575d7
39 changed files with 158 additions and 180 deletions

View 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);

View 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);