From d7ac09520be8f0d3d94df3dd4fd8a6e7404c0174 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Wed, 15 Sep 2021 10:56:21 +0200 Subject: 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. ``` --- src/nss-systemd/userdb-glue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nss-systemd') diff --git a/src/nss-systemd/userdb-glue.c b/src/nss-systemd/userdb-glue.c index c865ff0d82..002e6925f9 100644 --- a/src/nss-systemd/userdb-glue.c +++ b/src/nss-systemd/userdb-glue.c @@ -303,7 +303,7 @@ enum nss_status userdb_getgrnam( } if (!g) { - _cleanup_(_nss_systemd_unblockp) bool blocked = false; + _unused_ _cleanup_(_nss_systemd_unblockp) bool blocked = false; if (strv_isempty(members)) return NSS_STATUS_NOTFOUND; @@ -365,7 +365,7 @@ enum nss_status userdb_getgrgid( } if (!g) { - _cleanup_(_nss_systemd_unblockp) bool blocked = false; + _unused_ _cleanup_(_nss_systemd_unblockp) bool blocked = false; /* So, quite possibly we have to extend an existing group record with additional members. But * to do this we need to know the group name first. The group didn't exist via non-NSS -- cgit v1.2.1