[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Bug 902720] [NEW] TIME_MAX not set correctly for OpenB
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [Bug 902720] [NEW] TIME_MAX not set correctly for OpenBSD in qemu-common.h |
Date: |
Wed, 11 Jan 2012 10:55:04 -0000 |
Hi,
>>> 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).
Ouch. Adding 64bit arch with 32bit time_t is pretty lame IMHO. There
are a bunch of years left to fix that that though.
>>> #ifndef TIME_MAX
>>> #define TIME_MAX LONG_MAX
>>> #endif
>>>
>>> for OpenBSD this should be INT_MAX.
Guess we'll need an #ifdef then.
>> 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) {
With 32bit time_t lifetime wouldn't become larger than INT_MAX anyway,
so it doesn't matter ;)
> Still looking for comment on this since you added the initial code which
> has this bug in it.
cheers,
Gerd
--
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/902720
Title:
TIME_MAX not set correctly for OpenBSD in qemu-common.h
Status in QEMU:
New
Bug description:
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.
To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/902720/+subscriptions