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

Re: [PATCH v2] misra: add deviation of Rule 17.7


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>
  • Date: Tue, 26 Aug 2025 07:53:18 +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=TfzjJA1ldnUwm9meDMQznQW8Kv97zgxFXIvpL3JLImY=; b=TerBe5rWnZkpJiS3M28qalRz/9RrBZDY2neMAhinrDJOiDA+wLCaiHjKyM2wYPW0wxXfEF+gCb9YwUVauw+R7ILsYbFLxA/tirCmqRftv6lR9ynBHfiv8mI+mfLF5nED5IuAmAykRgjZiFU4wo4Vr6zym6fPKinMd4GKSeKaUJrQlpxk4joJ0ulBktVjPvyJ3b7IO/1NJ+P0lbha+G8X4dbqOjiwamK3yIA1xRvUWeUmYm5WMJkFgh+AHVxz20bj5RgBAdqTYnirqMaxPyzErTTxyhsWxPuiH5BvJnxaxdSl2L2GcymNBYrLTL5jeHGxKhJJC5fZAdEHMPaybTt0vw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KRI5D9hbieRQQU6BPpFQnOPB2WpcqzAj62JVsbBlSKIBZSLfk4vtXcDnTI0a5cVGnvuxyAhZ159ockF4E+6ctoYrwi2fbM1ko3SIe1KBrHjrObGnLDhXIL6+ozKCUJwBl+/A3YNFQkiuS0dOBDttCc3ow9ede75u7IFUAm2tvDOUt4rqzDHKoBRGS/UyTsjQ93nw3mF3s00HO4fXG9Tqktnkl8JXaqh9t6MgbitBn3a4i1pJRQuCeGW8X2o8hkk+kHCkQVNuT3KFR2m2RysoBc4RQymhxiAzDLNG//SrdQ8P37gF5AKXD68VYvD9fzPfRR/U543ruKPjwqVGk6gJYw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Doug Goldstein <cardoe@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: Tue, 26 Aug 2025 07:53:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHcFlwdO9JZfbniJ0qkcPaDWppdx7R0jhQAgAACKoA=
  • Thread-topic: [PATCH v2] misra: add deviation of Rule 17.7


On 8/26/25 10:45, Jan Beulich wrote:
> On 26.08.2025 09:36, Dmytro Prokopchuk1 wrote:
>> --- a/automation/eclair_analysis/ECLAIR/deviations.ecl
>> +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
>> @@ -575,6 +575,11 @@ safe."
>>   -config=MC3A2.R17.7,calls+={safe, "any()", 
>> "decl(name(__builtin_memcpy||__builtin_memmove||__builtin_memset||cpumask_check))"}
>>   -doc_end
>>   
>> +-doc_begin="It is safe to deviate functions like 'memcpy()', 'memset()', 
>> 'memmove()', as they return a value purely for convenience,
>> +their primary functionality (memory manipulation) remains unaffected, and 
>> their return values are generally non-critical and seldom relied upon."
>> +-config=MC3A2.R17.7,calls+={safe, "any()", 
>> "decl(name(memcpy||memset||memmove))"}
>> +-doc_end
>> +
>>   #
>>   # Series 18.
>>   #
>> --- a/docs/misra/deviations.rst
>> +++ b/docs/misra/deviations.rst
>> @@ -576,6 +576,13 @@ Deviations related to MISRA C:2012 Rules:
>>            - __builtin_memset()
>>            - cpumask_check()
>>   
>> +   * - R17.7
>> +     - It is safe to deviate functions like 'memcpy()', 'memset()', 
>> 'memmove()',
>> +       as they return a value purely for convenience, their primary 
>> functionality
>> +       (memory manipulation) remains unaffected, and their return values are
>> +       generally non-critical and seldom relied upon.
>> +     - Tagged as `safe` for ECLAIR.
> 
> I realize I may be overly nitpicky here, but in files named deviations.* I 
> find it
> odd to read "It is safe to deviate ...". I further find the use of "like" odd 
> when
> you enumerate the complete set anyway.
> 
> I wonder whether the deviation wants generalizing anyway: Informational return
> values are generally okay to ignore. That is, the Eclair configuration would 
> be
> limited to the three functions for now, but the text / comment could already 
> be
> broader. Then, for example, open-coded uses of the corresponding builtin 
> functions
> would also be covered right away.
> 
> Jan

Yes, fully agree with you.
I'll update it.
Thanks.

Dmytro.

 


Rackspace

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