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:
+2
-2
@@ -1758,7 +1758,7 @@ int manager_startup(Manager *m, FILE *serialization, FDSet *fds, const char *roo
|
||||
|
||||
{
|
||||
/* This block is (optionally) done with the reloading counter bumped */
|
||||
_cleanup_(manager_reloading_stopp) Manager *reloading = NULL;
|
||||
_unused_ _cleanup_(manager_reloading_stopp) Manager *reloading = NULL;
|
||||
|
||||
/* If we will deserialize make sure that during enumeration this is already known, so we increase the
|
||||
* counter here already */
|
||||
@@ -3275,7 +3275,7 @@ void manager_retry_runtime_watchdog(Manager *m) {
|
||||
}
|
||||
|
||||
int manager_reload(Manager *m) {
|
||||
_cleanup_(manager_reloading_stopp) Manager *reloading = NULL;
|
||||
_unused_ _cleanup_(manager_reloading_stopp) Manager *reloading = NULL;
|
||||
_cleanup_fdset_free_ FDSet *fds = NULL;
|
||||
_cleanup_fclose_ FILE *f = NULL;
|
||||
int r;
|
||||
|
||||
@@ -853,7 +853,7 @@ static int mount_private_dev(MountEntry *m) {
|
||||
char temporary_mount[] = "/tmp/namespace-dev-XXXXXX";
|
||||
const char *d, *dev = NULL, *devpts = NULL, *devshm = NULL, *devhugepages = NULL, *devmqueue = NULL, *devlog = NULL, *devptmx = NULL;
|
||||
bool can_mknod = true;
|
||||
_cleanup_umask_ mode_t u;
|
||||
_unused_ _cleanup_umask_ mode_t u;
|
||||
int r;
|
||||
|
||||
assert(m);
|
||||
|
||||
Reference in New Issue
Block a user