From 32fe735311bccb1a0cfe53cab9c07888c6e71690 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 6 Apr 2021 16:48:54 +0200 Subject: Silence warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- clock.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'clock.c') diff --git a/clock.c b/clock.c index e4a8ce2..0fb8647 100644 --- a/clock.c +++ b/clock.c @@ -140,6 +140,12 @@ display_clock(int timerfd) now->tm_sec += leap_insert = 1; } +#if defined(__GNUC__) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wformat-nonliteral" +# pragma GCC diagnostic ignored "-Wformat-truncation" +#endif + strftime(week, sizeof(week), week_fmt, now); len1 = snprintf(line1, sizeof(line1), "%i-(%02i)%.3s-%02i", now->tm_year + 1900, now->tm_mon + 1, &months[(size_t)now->tm_mon % 12 * 3], now->tm_mday); @@ -147,6 +153,10 @@ display_clock(int timerfd) &weekdays[(size_t)now->tm_mday % 7 * 3], week, tzname[now->tm_isdst]); len3 = snprintf(line3, sizeof(line3), "(@%ji%s)", (intmax_t)timex.time.tv_sec, leap_insert ? "+1" : ""); +#if defined(__GNUC__) +# pragma GCC diagnostic pop +#endif + printf("\033[H"); if (x >= 6 * LARGE_X + 2 * LARGE_XC && y > LARGE_Y + 1) { -- cgit v1.2.3-70-g09d2