[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 0/9] MISRA C 2012 8.1 rule fixes
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
- Date: Wed, 22 Jun 2022 13:55:44 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=2; 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=ZjlE6dYPhNAj0yRoH4imen+v3vVsAivOZq1XwC5ITtE=; b=a3DUmxFgyQyci6v4O7XzmqyLEU28tHE43aRD9VjIYi5ZdBNNdkBCF8yTEN0Ea+YcgAEe7qZvT5UuvnlrZd9GxoFo2Ybdeh7Yy60qw+QVl/ejusWAl0LL1TRC5QEO8SvcvfEGBNiWIJ+eZD0OMDzPVjzcZ2yNUdLfPnHLOVUmkHho242Sd7HD40d4lE6KW2aa/HXScPkXvwTIZUtlFBrieffImdDsj1HZJslT27VbIex/Y+WPADZnhNKdrdgbQ7Ei/gSDgwtmEPK0p9hB4UiHl6RgjrwONpy7rDw94XAGOTHrZkfgHIGsoaJPJxXrKSCXKr7hwghlazqpvjSBDtq0vg==
- 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=ZjlE6dYPhNAj0yRoH4imen+v3vVsAivOZq1XwC5ITtE=; b=g2JhfwC6DI/EZxVJ5GINVOjF/7vVmUaoUk/2XIwd6lmNXxVj+KZahve7Gnjw19AG7+shzbouHLr7FRTxitzsUo+QBDpmp6zaSECgnoL71qWzfbrUdaReHoioJDLTMm7rN5vxhahigsXtAl+J36ZGLZRPzLcqA5XAleKukg0NELajCXC2JtfmPYLwxselNbdPhSBwtJVrp5rnhHGxQiD+L2TAcJtehQz4JRrWQrZcHh0jIJJkFGMZWvwbVt2+6yxAtG0ZLU4QfSuB157ChkxeufdvScnI1q3iMc8FcWhYgV/FXHPafYlTeDgtxzR4ReW426/qBmbFtLoOdWPUiMfstQ==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=lUX1B/1h11NPbPpAgpIDcCHUZ9JNHo4Alzei4JwNj02KYUSvlAZDFbJdxXG8g9ItgOXzJz63QRETownE6Y5WarmpUJ6Fgv2XF54uBJq3Br0tepRdl3HXDHrCQWoe7qdVLoqeNriaeNgdLZKPZeBt+9uTBqXfI2d9k/IoowC8NHW4dQ2AK1q9iUAuhCtxClOL5RTMo+klU1uUJPRpK8YIC/0MahvQuwrzYokeeEOUsPKTCwux2sKVmO2SIbP44sq9TxH2xWy0yJC7P+GO52aSuF4A8duVFomQKjVOcbljqdd75/ALYAa7dxyEyobkCaEZX2OdLdhIBj9+mAkGK9wPrQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZgWg/DAFY/31kwl6JGRUmHrI+ABeg4Bf9ltiIQxwOervf8aB/EeznLoG0soy5AB6ceie5pqxrsTg8OuQQBJK5qI9WhzQrGQm76Cqr/npl/z/Wp9ojDPps93VXvgB16UlQitTmgkki82PaBF+8dxCYCs2PoYZHqyiddBAiUZtXNmJ/PCWeOmdnnVKq5lsqMJv4KwNEGQmaSJYQJhFsJaOr8ufCNPdGw1bpZbjlVad+P4l/xNh/AXDdnXK9mJQ/GBuGOUhfIngStnxKh8HvbB0YyzbHTx8qKrTNH71gneH2XmH2KyVj9ViPjtw6PwtaqgsFj8l6vCR0nNgWnEmx1EwFg==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: Michal Orzel <Michal.Orzel@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, 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>
- Delivery-date: Wed, 22 Jun 2022 13:56:05 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Thread-index: AQHYhHPRZL4o3B5WdE6OPtXA3biXiq1bO8sAgAAqE4CAAAG+gIAADwQA
- Thread-topic: [PATCH 0/9] MISRA C 2012 8.1 rule fixes
Hi Jan,
> On 22 Jun 2022, at 14:01, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>
> On 22.06.2022 14:55, Michal Orzel 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".
>>>
>> Cppcheck was choosed as a tool for MISRA checking and it is considering it
>> as a violation.
>
> Which by no means indicates that the tool pointing out something as a
> violation actually is one.
>
>> It treats unsigned as an implicit type. You can see this flag in cppcheck
>> source code:
>>
>> "fIsImplicitInt = (1U << 31), // Is "int" token implicitly added?"
>
> 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".
I am a bit puzzled here trying to understand what you actually want here.
Do you suggest the change is ok but you are not ok with the fact that is flagged
as MISRA fix even though cppcheck is saying otherwise ?
Bertrand
|