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

Re: [PATCH v2] misra: add deviations of MISRA C Rule 5.5


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>
  • Date: Mon, 28 Jul 2025 11:33:10 +0000
  • Accept-language: en-US, uk-UA, ru-RU
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=kBzefJDLim7rzwv9YOALB2S9BsGrqypj4SzKHzXJn7Q=; b=cJCT44oEgOqjzXRuOza7lxFwbNFpokWODwzWSpdZmYEshyNCOVt9HaD/IIEx8yR0DAieCPNq6lae/FaxbjoyqWgxM2wQYz3YsbYy5tiHqKv7V/Qm+VW5BrDZ96TiyD9Eijz5TMAD8xucd4oxQWZ3pXHxVzTj5tTujYPFunRyCmCiPoa8UXaMhjO+X0fkU6cYQmvZ4govzowspqNtSV5VFtA8xbEPaCBC+Jw2GnUEBDVoTfJjTXzRVMZPDTgMx2Y6ztNMJsbJ+RPAy1q0jg4qFbYT6DlP4GXls/ho+b/4EeiYC9m444bI/E0KXSpGQuPy8U79WPDA1mVxDsssVIbKlQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=G+dNV2K38Ak62fsEZWN1tIRTe0pqJnl8/aZZP3AJ6mcqTPHlp7oQMNNauX3HnuF6310s38Jq45RtK2sObQtSMp+KrIEDYp3Yt+bNEs1jm6wmWeUwG3IiRp7f4RudX9BQHwy/DsATXjOqm1Nq4npU1i+0CQyoHGzfI1FN7gln88s1M05nUwpDpRShQZCjNQbyZlYg8Z+YJdx6LHsqwPEnsXYjinQ1k9i0uKJGuG98DbkTjThRhBsc2d8CT80aH2V1VKmeGIfaP3z6bSQo2XxMMrNEsIslTVD2SrYmTXtN6JRVCFnAhIg9cY9G8hNSETyL8DFR0cv5aWNDeCOnZAOmVA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>, Doug Goldstein <cardoe@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 28 Jul 2025 11:33:20 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHb/YCHt9uHUQWtj0esBUS8Oj/ZKbRHS1IAgAAgdoA=
  • Thread-topic: [PATCH v2] misra: add deviations of MISRA C Rule 5.5


On 7/28/25 12:36, Jan Beulich wrote:
> On 25.07.2025 18:24, Dmytro Prokopchuk1 wrote:
>> --- a/docs/misra/deviations.rst
>> +++ b/docs/misra/deviations.rst
>> @@ -142,6 +142,31 @@ Deviations related to MISRA C:2012 Rules:
>>          memmove.
>>        - Tagged as `deliberate` for ECLAIR.
>>   
>> +   * - R5.5
>> +     - Clashes between bitops functions and macros names are deliberate and 
>> are
>> +       needed for input validation and error handling, ensures that the 
>> size of
>> +       the object being pointed to by 'addr' meets the minimum requirements 
>> for
>> +       the bit operation, preventing unsafe operations on improperly sized 
>> data
>> +       types that could lead to undefined behavior or memory corruption.
>> +       The macros encapsulate this conditional logic into a single, 
>> reusable form;
>> +       which simplifies the code, avoids redundant function call.
>> +     - Specified macros should be ignored.
> 
> At the risk of going too far with nitpicking: Who are "specified macros" 
> here? The
> text doesn't mention any names. In fact, the way it's written it could be 
> taken to
> mean all macros there, including any that are yet to be added. I don't think 
> such
> is appropriate for a deviation.
> 
>> +   * - R5.5
>> +     - Clashes between 'pirq_cleanup_check' function and macro names are 
>> deliberate.
>> +       The purpose is to ensure that the specific cleanup action 
>> ('pirq_cleanup_check')
>> +       is performed conditionally when the parameter 'event channel number' 
>> equals
>> +       zero, otherwise it does nothing.
>> +       This approach simplifies the code, avoids redundant function call.
>> +     - Specified macro should be ignored.
> 
> Here it's clear which macro is meant, but ...
> 
>> +   * - R5.5
>> +     - Clashes between grant table functions and macros names are 
>> deliberate.
>> +       These macros address differences in argument count during 
>> compile-time,
>> +       effectively discarding unused parameters to avoid warnings or errors
>> +       related to unused arguments.
>> +     - Specified macro should be ignored.
> 
> ... here it again isn't.
> 
> Jan

Thanks!
I'll add macros names.

Dmytro

 


Rackspace

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