All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Weil <sw@weilnetz.de>
To: Bug 902720 <902720@bugs.launchpad.net>
Cc: qemu-devel@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] [Bug 902720] [NEW] TIME_MAX not set correctly for OpenBSD in qemu-common.h
Date: Sun, 11 Dec 2011 11:53:16 +0100	[thread overview]
Message-ID: <4EE48B9C.5060202@weilnetz.de> (raw)
In-Reply-To: <20111211064733.26491.7785.malonedeb@soybean.canonical.com>

Am 11.12.2011 07:47, schrieb Brad Smith:
> Public bug reported:
>
> Looking at the OpenBSD buildbot logs I noticed a warning that appears 
> to be a bug in the code.
> OpenBSD has a 32-bit time_t on all archs at the moment (32-bit and 
> 64-bit).
>
> CC i386-softmmu/monitor.o
> /buildbot-qemu/default_openbsd_current/build/monitor.c: In function 
> 'expire_password':
> /buildbot-qemu/default_openbsd_current/build/monitor.c:944: warning: 
> overflow in implicit constant conversion
>
> qemu-common.h has...
>
> #ifndef TIME_MAX
> #define TIME_MAX LONG_MAX
> #endif
>
> for OpenBSD this should be INT_MAX.
>
> ** Affects: qemu
> Importance: Undecided
> Status: New

This needs special handling for w32 / w64, too.
Looking at the code where TIME_MAX is used, I assume that
more fixes are needed. The following code for example
won't work:

   if (lifetime > INT_MAX) {

What about using

   #define TIME_FOREVER -1

instead of TIME_MAX? Of course this would need additional
code changes.

Regards,
Stefan Weil

  reply	other threads:[~2011-12-11 10:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-11  6:47 [Qemu-devel] [Bug 902720] [NEW] TIME_MAX not set correctly for OpenBSD in qemu-common.h Brad Smith
2011-12-11 10:53 ` Stefan Weil [this message]
2012-01-10 23:42 ` Brad Smith
2012-01-11 10:55   ` Gerd Hoffmann
2017-10-28 14:44 ` [Qemu-devel] [Bug 902720] " Thomas Huth
2017-10-28 15:58 ` Brad Smith
2017-10-28 16:43 ` Thomas Huth
2018-04-13 10:49 ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EE48B9C.5060202@weilnetz.de \
    --to=sw@weilnetz.de \
    --cc=902720@bugs.launchpad.net \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.