From cf8c19173845ca653f89dc7acb56d68c002788c1 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 14 Dec 2020 15:56:55 +0100 Subject: [PATCH] hwclock: fix compiler warnings [-Wmaybe-uninitialized] sys-utils/hwclock-rtc.c: In function 'synchronize_to_clock_tick_rtc': sys-utils/hwclock.c:169:28: warning: 'now.tv_usec' may be used uninitialized in this function [-Wmaybe-uninitialized] sys-utils/hwclock-rtc.c:215:24: note: 'now.tv_usec' was declared here sys-utils/hwclock.c:168:28: warning: 'now.tv_sec' may be used uninitialized in this function [-Wmaybe-uninitialized] sys-utils/hwclock-rtc.c:215:24: note: 'now.tv_sec' was declared here sys-utils/hwclock.c:169:28: warning: 'begin.tv_usec' may be used uninitialized in this function [-Wmaybe-uninitialized] sys-utils/hwclock-rtc.c:215:17: note: 'begin.tv_usec' was declared here sys-utils/hwclock.c:168:28: warning: 'begin.tv_sec' may be used uninitialized in this function [-Wmaybe-uninitialized] sys-utils/hwclock-rtc.c:215:17: note: 'begin.tv_sec' was declared here Signed-off-by: Karel Zak --- sys-utils/hwclock-rtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys-utils/hwclock-rtc.c b/sys-utils/hwclock-rtc.c index fb94868481..163f04e7a5 100644 --- a/sys-utils/hwclock-rtc.c +++ b/sys-utils/hwclock-rtc.c @@ -212,7 +212,7 @@ static int busywait_for_rtc_clock_tick(const struct hwclock_control *ctl, /* The time when we were called (and started waiting) */ struct tm nowtime; int rc; - struct timeval begin, now; + struct timeval begin = { 0 }, now = { 0 }; if (ctl->verbose) { printf("ioctl(%d, RTC_UIE_ON, 0): %s\n", -- 2.47.2