From 2a371001f8d23533a339a150eeffa3215773058d Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Thu, 25 Apr 2013 20:53:29 -0400 Subject: Use attribute(unused) in PROTECT_ERRNO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/shared/util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/shared/util.h') diff --git a/src/shared/util.h b/src/shared/util.h index 68e87da7cd..e3fc876857 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -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; -- cgit v1.2.3-54-g00ecf