[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


  • To: Juergen Gross <jgross@xxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 10 Jun 2022 11:55:12 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8dIv2tz0F8UNY0fk7k6SDge/lwFDkLp5KvmHcM4Wrro=; b=KZTQXnEzAiV1HLVdSiLeGo/oJdgGgRsdrdrC9HXKC6E6oPs/aJLMquF8IYHjBAlp3YyWqdm3oAyNtA1+te9B0K/n1DIWrbzculMd8P+reudlWUiCo8qu5iX250dqLL9wE9H+okv6ovadIsnlvwR+q1QkzlAeKpV9BhuiWq2rCfslZxA+0JQ+niee4tDZ3fIQaaZkM3XPp9jJihONhskWd3iUnhOR+KMiMSmOMpZR5XHXhljrl0LIKAkeUe5lRWZQ13zEw5hm/6tdJUddGAB7xBWg6bkYUrCxoxfygWT2qRJzyAKI4u7XqSMfeJCUj+U8OIgUCDz5h15RyW8Ju9/bYw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WuBKkmR5xTvxmrwQ0pJqSPMvswpEbKOnHyg1OqOUhMXk4WMZmOfinsMl8W+Ml6QzjCBhHjrHiPkScgNaEkC5LHBzMCKLgNFAzYjOwU972Kny2uL3aRPqqDRyb21CgXXuVyP69EzlVZAgNEqxqO1Bq+Ip13djkXq77lvZ7NU14fOxM831tdckiaYtUwZ3oLnTP0NkqYdmXXT0QutMziAXMltR5EWA0Pb+xqFm3ZbrVgHVKgHFcsAKmwuXuybhMVwUX1a0Hf0Pyox7Hdm3MgqQQyuOMXwT4YETE89Mzg4WEYbq07+LnrVrlHd0VQ71TqSrio4GbBKn8If4+dUbZV3/MQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 10 Jun 2022 09:55:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 10.06.2022 11:51, Juergen Gross wrote:
> On 10.06.22 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.
> 
> Don't you think keeping struct tm in sync with the Posix definition should
> be preferred here?

Not necessarily, no. It's not just POSIX which has a (imo bad) habit of
using plain "int" even for values which can never go negative.

Jan



 


Rackspace

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