From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34020) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDhOe-0007ZA-K0 for qemu-devel@nongnu.org; Fri, 30 Mar 2012 15:22:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SDhOc-0006nx-S8 for qemu-devel@nongnu.org; Fri, 30 Mar 2012 15:22:04 -0400 Received: from mail-ob0-f173.google.com ([209.85.214.173]:44635) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDhOc-0006mg-O4 for qemu-devel@nongnu.org; Fri, 30 Mar 2012 15:22:02 -0400 Received: by obbwd20 with SMTP id wd20so1510573obb.4 for ; Fri, 30 Mar 2012 12:22:01 -0700 (PDT) Message-ID: <4F7607D6.40003@codemonkey.ws> Date: Fri, 30 Mar 2012 14:21:58 -0500 From: Anthony Liguori MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] qtest: avoid a warning with RTC test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: Paolo Bonzini , Anthony Liguori , qemu-devel On 03/30/2012 02:19 PM, Blue Swirl wrote: > Avoid this warning on OpenBSD: > CC tests/rtc-test.o > /src/qemu/tests/rtc-test.c: In function 'check_time': > /src/qemu/tests/rtc-test.c:171: warning: format '%ld' expects type > 'long int', but argument 2 has type 'time_t' > /src/qemu/tests/rtc-test.c:173: warning: format '%ld' expects type > 'long int', but argument 2 has type 'time_t' > > Signed-off-by: Blue Swirl Reviewed-by: Anthony Liguori Regards, Anthony Liguori > --- > > v2: make t and s longs. > > --- > tests/rtc-test.c | 6 +++--- > 1 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/tests/rtc-test.c b/tests/rtc-test.c > index c32b36a..983a980 100644 > --- a/tests/rtc-test.c > +++ b/tests/rtc-test.c > @@ -161,12 +161,12 @@ static void check_time(int wiggle) > } > > if (!(tm_cmp(&start, datep)<= 0&& tm_cmp(datep,&end)<= 0)) { > - time_t t, s; > + long t, s; > > start.tm_isdst = datep->tm_isdst; > > - t = mktime(datep); > - s = mktime(&start); > + t = (long)mktime(datep); > + s = (long)mktime(&start); > if (t< s) { > g_test_message("RTC is %ld second(s) behind > wall-clock\n", (s - t)); > } else {