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

Re: [XEN PATCH] x86/cpu-policy: justify a violation of MISRA C:2012 Rule 1.3


  • To: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 1 Aug 2023 15:40:01 +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=How/S47Xv9emA9E1mw2tT1xwEq8x3RCZXP65VyZuHWk=; b=Spvh6rqIkVbHXKmxS/+ZRV26NNu8wYvX8h7nyoEdIyMFPoH5AgZ+WDjAHUeSEtMTfoyWlkUhNUfgAty1UJcU9LG6jUTDs6jdJjqDYbmRIDMQTQ3anOW0g2Fy7BgUBYKmodbXY5rJfvTqfPITQCJcdXaZ5QVCMvtas3ysuiNFJM1bEhXJFVMqH65Ef1gNR/FXa1bm0ejAhvV6Oiv1p0HumxpljHgxUZvpB/C4wU8FbqGduQ9JolEceNmVxgzZC7xMil/wfBlN6lNpsEt8OsLCFk9MmDP/QEzH8u0ltJO5A23p6irus6m8OU9CulopLvlcXHUCnksG2cgxCfvDX4dsXA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WzJH4stPdSJdHl5TKNx9FsJqI3iXm3IPRgWayWnG2S//Izws3QuvuNAnxM9znd3u5p/fFDfNry7RwCG5KRViq+MKa1vQFSJAxDXOf+c9oO337yvGuikBP5BNiE0RFeRkW13ChwlQtmJiGSVrUNG2Fu5jShE0L6GAdTR4IQvTEEBfCorwmUIA2aiCtQK0M7Xugmm7uuJWhKKzHertC58oK5s8FBFcQg/nFbt5AhpZ/sEAO0b6mMYlHRAmP38vlAfePoTmLiMnZmOnRyJR2MmSajgwVpKygCz9RMAu6iedfNfC3cLs3usxW0JsecGddCQSDuBxgNrKtbZhfWnkAhwGWg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: sstabellini@xxxxxxxxxx, michal.orzel@xxxxxxx, xenia.ragiadakou@xxxxxxx, ayan.kumar.halder@xxxxxxx, consulting@xxxxxxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 01 Aug 2023 13:40:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 01.08.2023 15:06, Nicola Vetrini wrote:
> The empty feature set 'str_7c1' in 'tools/misc/xen-cpuid.c' causes the
> struct declaration to have no named members, hence violating
> Rule 1.3:
> "There shall be no occurrence of undefined or critical unspecified behaviour"
> because it is forbidden by ISO/IEC 9899:1999(E), Section 6.7.2.1.7:
> "If the struct-declaration-list contains no named
> members, the behavior is undefined."
> 
> It has been assessed that the feature set declaration is intentionally empty,
> and that no risk of undesired behaviour stems from it, hence the struct
> declaration is marked safe.
> 
> No functional changes.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
> ---
> As agreed during the MISRA C group meetings, this violation is dealt
> with by means of a comment deviation, as future changes may eliminate the
> root cause, which is the empty feature set.
> My justification for the claim and the commit message may need some adjusting.

A reference to the compiler extension would be nice; the use of extensions
(which generally are well-defined, even if not always well-documented)
should eliminate the UB that the standard specifies.

Jan



 


Rackspace

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