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

Re: [PATCH 3/3] xen/console: Fix incorrect format tags for struct tm members



Hi Jan,

On 10.06.2022 11:44, Jan Beulich wrote:
> On 10.06.2022 10:33, Michal Orzel wrote:
>> All the members of struct tm are defined as integers but the format tags
>> used in console driver for snprintf wrongly expect unsigned values. Fix
>> the tags to expect integers.
> 
> Perhaps do things the other way around - convert field types to unsigned
> unless negative values can be stored there? This would match our general
> aim of using unsigned types when only non-negative values can be held in
> variables / parameters / fields.
> 

The reason why I did not do this is to be coherent with Linux kernel 
(include/linux/time.h).
I believe the time.h code in Xen comes from Linux.

So if the Linux time.h defines these fields as integers and uses proper %d 
format specifiers (unlike Xen),
I think my solution is better.

> Jan
Cheers,
Michal



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.