tree-wide: mark set-but-not-used variables as unused to make LLVM happy
LLVM 13 introduced `-Wunused-but-set-variable` diagnostic flag, which
trips over some intentionally set-but-not-used variables or variables
attached to cleanup handlers with side effects (`_cleanup_umask_`,
`_cleanup_(notify_on_cleanup)`, `_cleanup_(restore_sigsetp)`, etc.):
```
../src/basic/process-util.c:1257:46: error: variable 'saved_ssp' set but not used [-Werror,-Wunused-but-set-variable]
_cleanup_(restore_sigsetp) sigset_t *saved_ssp = NULL;
^
1 error generated.
```
This commit is contained in:
@@ -274,7 +274,7 @@ static int dns_cache_link_item(DnsCache *c, DnsCacheItem *i) {
|
||||
|
||||
first = hashmap_get(c->by_key, i->key);
|
||||
if (first) {
|
||||
_cleanup_(dns_resource_key_unrefp) DnsResourceKey *k = NULL;
|
||||
_unused_ _cleanup_(dns_resource_key_unrefp) DnsResourceKey *k = NULL;
|
||||
|
||||
/* Keep a reference to the original key, while we manipulate the list. */
|
||||
k = dns_resource_key_ref(first->key);
|
||||
|
||||
@@ -165,7 +165,7 @@ static int dns_query_candidate_add_transaction(
|
||||
}
|
||||
|
||||
static int dns_query_candidate_go(DnsQueryCandidate *c) {
|
||||
_cleanup_(dns_query_candidate_unrefp) DnsQueryCandidate *keep_c = NULL;
|
||||
_unused_ _cleanup_(dns_query_candidate_unrefp) DnsQueryCandidate *keep_c = NULL;
|
||||
DnsTransaction *t;
|
||||
int r;
|
||||
unsigned n = 0;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
static int run(int argc, char *argv[]) {
|
||||
_cleanup_(manager_freep) Manager *m = NULL;
|
||||
_cleanup_(notify_on_cleanup) const char *notify_stop = NULL;
|
||||
_unused_ _cleanup_(notify_on_cleanup) const char *notify_stop = NULL;
|
||||
int r;
|
||||
|
||||
log_setup();
|
||||
|
||||
Reference in New Issue
Block a user