Use attribute(unused) in PROTECT_ERRNO
clang emits warnings about unused attribute _saved_errno_, which drown out other—potentially useful—warnings. gcc documentation is not exactly verbose about the effects of __attribute__((unused)) on variables, but let's assume that it works if the unit test passes.
This commit is contained in:
@@ -1208,7 +1208,6 @@ int cg_pid_get_path_shifted(pid_t pid, char **root, char **cgroup) {
|
||||
}
|
||||
|
||||
int cg_path_decode_unit(const char *cgroup, char **unit){
|
||||
_cleanup_free_ char *unescaped = NULL;
|
||||
char *p, *e, *c, *s, *k;
|
||||
|
||||
assert(cgroup);
|
||||
|
||||
+1
-1
@@ -644,7 +644,7 @@ static inline void _reset_errno_(int *saved_errno) {
|
||||
errno = *saved_errno;
|
||||
}
|
||||
|
||||
#define PROTECT_ERRNO _cleanup_(_reset_errno_) int _saved_errno_ = errno
|
||||
#define PROTECT_ERRNO _cleanup_(_reset_errno_) __attribute__((unused)) int _saved_errno_ = errno
|
||||
|
||||
struct _umask_struct_ {
|
||||
mode_t mask;
|
||||
|
||||
Reference in New Issue
Block a user