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)