Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C59E0C433EF for ; Wed, 22 Jun 2022 12:56:25 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.353852.580844 (Exim 4.92) (envelope-from ) id 1o3ztu-0004FX-Lf; Wed, 22 Jun 2022 12:56:06 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 353852.580844; Wed, 22 Jun 2022 12:56:06 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o3ztu-0004FQ-Ho; Wed, 22 Jun 2022 12:56:06 +0000 Received: by outflank-mailman (input) for mailman id 353852; Wed, 22 Jun 2022 12:56:04 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o3zts-0004FK-KH for xen-devel@lists.xenproject.org; Wed, 22 Jun 2022 12:56:04 +0000 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by se1-gles-flk1.inumbo.com (Halon) with ESMTP id abe18e63-f22a-11ec-b725-ed86ccbb4733; Wed, 22 Jun 2022 14:56:03 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8F71613D5; Wed, 22 Jun 2022 05:56:02 -0700 (PDT) Received: from [10.57.38.102] (unknown [10.57.38.102]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 77BC83F534; Wed, 22 Jun 2022 05:55:59 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: abe18e63-f22a-11ec-b725-ed86ccbb4733 Message-ID: <74ec2158-3d19-3b2c-1e8c-fb5b30267658@arm.com> Date: Wed, 22 Jun 2022 14:55:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH 0/9] MISRA C 2012 8.1 rule fixes Content-Language: en-US To: Jan Beulich Cc: Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk , Andrew Cooper , George Dunlap , Wei Liu , Juergen Gross , Dario Faggioli , Daniel De Graaf , "Daniel P. Smith" , xen-devel@lists.xenproject.org References: <20220620070245.77979-1-michal.orzel@arm.com> From: Michal Orzel In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Jan, On 22.06.2022 12:25, Jan Beulich wrote: > On 20.06.2022 09:02, Michal Orzel wrote: >> This series fixes all the findings for MISRA C 2012 8.1 rule, reported by >> cppcheck 2.7 with misra addon, for Arm (arm32/arm64 - target allyesconfig). >> Fixing this rule comes down to replacing implicit 'unsigned' with explicit >> 'unsigned int' type as there are no other violations being part of that rule >> in the Xen codebase. > > I'm puzzled, I have to admit. While I agree with all the examples in the > doc, I notice that there's no instance of "signed" or "unsigned" there. > Which matches my understanding that "unsigned" and "signed" on their own > (just like "long") are proper types, and hence the omission of "int" > there is not an "omission of an explicit type". > Cppcheck was choosed as a tool for MISRA checking and it is considering it as a violation. It treats unsigned as an implicit type. You can see this flag in cppcheck source code: "fIsImplicitInt = (1U << 31), // Is "int" token implicitly added?" > Nevertheless I think we have had the intention to use "unsigned int" > everywhere, but simply for cosmetic / style reasons (while I didn't ever > see anyone request the use of "long int" in place of "long", despite it > also being possible to combine with "double"), so I'm happy to see this > being changed. Just that (for now) I don't buy the justification. > > Jan Cheers, Michal