From 098223cf6d7214ba49815e06babd20dbbe85a79e Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Tue, 7 Feb 2017 17:28:06 -0500 Subject: [PATCH] Second try at silencing "unused" warning for strerror_r --- tz.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tz.cpp b/tz.cpp index 1f887c9..29486d9 100644 --- a/tz.cpp +++ b/tz.cpp @@ -3083,6 +3083,12 @@ current_zone() #else // !WIN32 +#ifdef __GNUC__ +// GCC complains about unused return from strerror_r +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-result" +#endif + const time_zone* current_zone() { @@ -3160,6 +3166,10 @@ current_zone() throw std::runtime_error("Could not get current timezone"); } +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif + #endif // !WIN32 #if defined(TZ_TEST) && defined(TIMEZONE_MAPPING)