From mboxrd@z Thu Jan 1 00:00:00 1970 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 D4A57C433EF for ; Wed, 22 Jun 2022 19:24:48 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.354291.581354 (Exim 4.92) (envelope-from ) id 1o45xT-00082P-HK; Wed, 22 Jun 2022 19:24:11 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 354291.581354; Wed, 22 Jun 2022 19:24:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o45xT-00082I-EA; Wed, 22 Jun 2022 19:24:11 +0000 Received: by outflank-mailman (input) for mailman id 354291; Wed, 22 Jun 2022 19:24:10 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o45xS-00082C-2I for xen-devel@lists.xenproject.org; Wed, 22 Jun 2022 19:24:10 +0000 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id e2d7c335-f260-11ec-bd2d-47488cf2e6aa; Wed, 22 Jun 2022 21:24:08 +0200 (CEST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3070DB81F2A; Wed, 22 Jun 2022 19:24:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 484D7C34114; Wed, 22 Jun 2022 19:24:05 +0000 (UTC) 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: e2d7c335-f260-11ec-bd2d-47488cf2e6aa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655925846; bh=WWkDom5U0fFW2T5yf+nx5KbkERxvChYw4S75KNRbsg8=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=qdnWUYBK3GDaDHms+YmDm72clarUCcfnHkQwoVbmQbWbjWsi7TDd3vMoluReO1r6G P/zOjHAQR+OKmdcwCzW4CO5frXpQ6IdplZUrqjPzl2AjI9rhzNtT+7D/eEVZxCAl0+ +sY0DbflpWRxUdGQFeYk5eKgxplj1J6/OsQNgrm2HMZz5hlgA1Ck/YrfbWmkPRFpGT Y8zjmVWLHGfw46tPX2W9jm7PPzr3wsxptdu68Ss4Gi/XiGj4COzn5pzHkgpqnmViQm kcbreUOtO4o14pNa+mWQ8w6TZYNZ/AzDgPc5RreDJWt6dJF2YrtpE+9jDQuC5/7528 U+T+yv0KfZa1w== Date: Wed, 22 Jun 2022 12:23:29 -0700 (PDT) From: Stefano Stabellini X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop To: roberto.bagnara@bugseng.com cc: Bertrand Marquis , Michal Orzel , Stefano Stabellini , Julien Grall , Volodymyr Babchuk , Andrew Cooper , George Dunlap , Wei Liu , Juergen Gross , Dario Faggioli , Daniel De Graaf , jbeulich@suse.com, "Daniel P. Smith" , "xen-devel@lists.xenproject.org" Subject: Re: [PATCH 0/9] MISRA C 2012 8.1 rule fixes In-Reply-To: <7a8d70e3-c331-426d-fe96-77bd65caade7@suse.com> Message-ID: References: <20220620070245.77979-1-michal.orzel@arm.com> <74ec2158-3d19-3b2c-1e8c-fb5b30267658@arm.com> <68d7fb35-e4c5-e5d2-13a8-9ee1369e8dbe@suse.com> <7a8d70e3-c331-426d-fe96-77bd65caade7@suse.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII +Roberto Hi Roberto, A quick question about Rule 8.1. Michal sent a patch series to fix Xen against Rule 8.1 (here is a link if you are interested: https://marc.info/?l=xen-devel&m=165570851227125) Although we all generally agree that the changes are a good thing, there was a question about the rule itself. Specifically, is the following actually a violation? unsigned x; Looking through the examples in the MISRA document I can see various instances of more confusing and obvious violations such as: const x; extern x; but no examples of using "unsigned" without "int". Do you know if it is considered a violation? Thanks! Cheers, Stefano On Wed, 22 Jun 2022, Jan Beulich wrote: > >>>>> 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". [...] > >>>> Neither the name of the variable nor the comment clarify that this is about > >>>> the specific case of "unsigned". As said there's also the fact that they > >>>> don't appear to point out the lack of "int" when seeing plain "long" (or > >>>> "long long"). I fully agree that "extern x;" or "const y;" lack explicit > >>>> "int".