Ignore GCC warnings.

* 4.9 missing initializer warnings
* pedantic for __int128 case
* Wrap diagnostic push and pop in tz.cpp and date.h.
This commit is contained in:
Florian Dang
2017-04-01 12:36:54 -04:00
committed by Howard Hinnant
parent f30450b4c5
commit c4c2550b29
2 changed files with 27 additions and 20 deletions
+11 -10
View File
@@ -141,6 +141,12 @@ static CONSTDATA char folder_delimiter = '/';
#endif
#if __GNUC__ < 5
// GCC 4.9 Bug 61489 Wrong warning with -Wmissing-field-initializers
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#endif
#ifdef _WIN32
namespace
@@ -3100,12 +3106,6 @@ 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()
{
@@ -3183,10 +3183,6 @@ 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)
@@ -3208,4 +3204,9 @@ locate_native_zone(const std::string& native_tz_name)
#endif // TZ_TEST && TIMEZONE_MAPPING
} // namespace date
#if __GNUC__ < 5
# pragma GCC diagnostic pop
#endif