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

Re: [PATCH 0/9] MISRA C 2012 8.1 rule fixes


  • To: Roberto Bagnara <roberto.bagnara@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 23 Jun 2022 09:51:58 +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=8u46eZwMH4FPHFe6gHdQDzIJWbmFBrZxoBP7fCjuaII=; b=JKF4/pGCihD31viDJ1H8HyqSs0r5f/GHAyAzRt2L6H2/82psRXgULRCIfhrpxp91paoriAwcG9xvtIW1juWFG+J5gwCt9uQtKD3cB6qJ21/3gfsnBUV017AlOoVVRvlfh1I3QWg9I8z4cvNg71y+B5eWwo2a5l++Lyb+wxybD7PSwF8pq1C02Gtk04k9lLUWZfFng5vjdST/AFb/30noggjL8c6BMbWR0WS0uDmuC33mbHsK2XyLhA9YuZIuBq4KuNS02RFaNx5JtxuzZLGIBEJwbsMLodpW+Ck4KMs28mKsFbGfq4Ao6+YjRfqhrS25j2Yp2+a6x9pZZgKTwXN6Ww==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RKpgxoybsXsYqp+YisPaVjpg8KHxJ/RBe/iywsOcEy1Ney0rohQyIoTBhgdVt/qC4yU6+b8i9GbNtVKJd2fEYe1EzYPjcvhRTPo/FcJ5oIK3WWzEMLGSyGINLAAvhuuZX3jZaMb7boB88hE268lmRLARDN5D/q38jRehT+uRPcsIZc6GhRKxojwJlF97wbNXEkcTyjr3PL0wiesm1jX2ZOFaYFymwDARe68SGLtU+2rm4BKe3dKJnwxuVWNvEznPFeAk3xQP9KGkT4P9CTR6jNr1EvuiqzQP+AC4y1jPRdPYun9nMHbUX8Qq1Mz3KCGjfqlAZirRqkLq4F3byNdmiQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Michal Orzel <Michal.Orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Dario Faggioli <dfaggioli@xxxxxxxx>, Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Thu, 23 Jun 2022 07:52:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 23.06.2022 09:37, Roberto Bagnara wrote:
> Rule 8.1 only applies to C90 code, as all the violating instances are
> syntax errors in C99 and later versions of the language.  So,
> the following line does not contain a violation of Rule 8.1:
> 
>      unsigned x;
> 
> It does contain a violation of Directive 4.6, though, whose correct
> handling depends on the intention (uint32_t, uin64_t, size_t, ...).

Interesting - this goes straight against a rule we have set in
./CODING_STYLE. I'm also puzzled by you including size_t in your list
of examples, when the spec doesn't. The sole "goal" of the directive
(which is advisory only anyway) is to be able to determine allocation
size. size_t size, however, varies as much as short, int, long, etc
do.

Jan



 


Rackspace

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