TIME_MAX not set correctly for OpenBSD in qemu-common.h
Bug #902720 reported by
Brad Smith
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Fix Released
|
Undecided
|
Unassigned |
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/
/buildbot-
/buildbot-
qemu-common.h has...
#ifndef TIME_MAX
#define TIME_MAX LONG_MAX
#endif
for OpenBSD this should be INT_MAX.
Changed in qemu: | |
status: | Incomplete → Triaged |
To post a comment you must log in.
On 11/12/11 5:53 AM, Stefan Weil wrote: monitor. o qemu/default_ openbsd_ current/ build/monitor. c: In function qemu/default_ openbsd_ current/ build/monitor. c:944: warning:
> 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/
>> /buildbot-
>> 'expire_password':
>> /buildbot-
>> 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
Gerd?
Still looking for comment on this since you added the initial code which
has this bug in it.
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.