qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-2.11?] osdep.h: Make TIME_MAX handle differe


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH for-2.11?] osdep.h: Make TIME_MAX handle different time_t types
Date: Fri, 24 Nov 2017 15:13:07 +0000

On 23 November 2017 at 16:00, Paolo Bonzini <address@hidden> wrote:
> On 23/11/2017 16:56, Peter Maydell wrote:
>> In our various supported host OSes, the time_t type may be either 32
>> or 64 bit, and could in theory also be either signed or unsigned.
>> Notably, in OpenBSD time_t is a 64 bit type even if 'long' is 32
>> bits, so using LONG_MAX for TIME_MAX is incorrect.
>>
>> Use an approach suggested by Paolo Bonzini which calculates
>> the maximum value of the type rather than hardcoding it;
>> to do this we use the TYPE_MAXIMUM macro from Gnulib.
>>
>> Suggested-by: Paolo Bonzini <address@hidden>
>> Signed-off-by: Peter Maydell <address@hidden>
>> ---

> Reviewed-by: Paolo Bonzini <address@hidden>

Thanks; applied to master.

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]