From: Sven Eden Date: Tue, 12 Dec 2017 17:02:58 +0000 (+0100) Subject: time-util: Disable explicit fallthrough wanring on gcc-7+ X-Git-Tag: v235.1~22 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=4aa1429c95d025f9373bd63d04acdf2552aef576;p=elogind.git time-util: Disable explicit fallthrough wanring on gcc-7+ --- diff --git a/src/basic/time-util.c b/src/basic/time-util.c index 7f32cf608..68cbacc30 100644 --- a/src/basic/time-util.c +++ b/src/basic/time-util.c @@ -1383,6 +1383,12 @@ clockid_t clock_boottime_or_monotonic(void) { } #endif // 0 +#if 1 /// let's add a diagnostic push to silence -Wimplicit-fallthrough to elogind +# if defined(__GNUC__) && (__GNUC__ > 6) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +# endif // __GNUC__ +#endif // 1 bool clock_supported(clockid_t clock) { struct timespec ts; @@ -1406,6 +1412,11 @@ bool clock_supported(clockid_t clock) { return clock_gettime(clock, &ts) >= 0; } } +#if 1 /// end diagnostic push in elogind +# ifdef __GNUC__ +# pragma GCC diagnostic pop +# endif // __GNUC__ +#endif // 1 #if 0 /// UNNEEDED by elogind int get_timezone(char **tz) {