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

[PATCH v3] misra: add deviation of Rule 17.7


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>
  • Date: Thu, 28 Aug 2025 06:57:46 +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=CZsbZ24vS3rG+xfPUBb489470z9KNa3fH6cDTw3lSxc=; b=itxa9Um2uoaRo3vyX995vbT7705tSI+AQJ3uejFbygz+j48j+bVjq8FO2kGOpo0F6VI/DMtT6qU6KnYvWD8HxqXAmTfRUgHvfvZE+4RuSL+6tZVLUtTxl9TQf3iaP+hYY2sXGPcfEKGYfch+YdVt2DUUuPnkjMUdSoTZirYENAsFd6MLivtSnLDcomnuoGSBNMLZFgciEaA85PL/LhKFmOcMcvV6RfHCM3XEttYzUHZHFxyCY0AGQ9ktX+jR/bSud15PB7ci6FwFHshHytQm1I3xTlbJFDsloH1cMwKjLWrFAvyzM3iW/dmK+XWgTdcnE8LAbrud9LZQok1F6qms6g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vtN+WICcO+jVbPCki5tHYxUZairXtjtFskdSThW6UFUF/JZ+Rsup2jgDNUn2iJswWfsw03rccueh6vnieUTy9oO0pPPkS+/8s9KnnAoG5GG3oWFypdsF/ud3MGP6zGIs6ulXSZs6Tzk8Rzn5GWf9vXEd1fyUUVcFYaI1/MI48lhIHPxU0VHDexHRsVkutFedisCajCR+53UU8dNsOEMMOVGJCbZphh46vAlfknNWsytGEKkIL/v2kx4F5xdpszV4TuXIxGwudja/xaMki9b4iZzMZZ6KEIaQyfd9y7y5qHX+cSTqn5SkCStfistBfMBV83z/yZG4tDlzkrGFHDN5Rw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>, 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>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Thu, 28 Aug 2025 06:57:54 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHcF+kPfUt2YGXFDECwb77KUjWXzg==
  • Thread-topic: [PATCH v3] misra: add deviation of Rule 17.7

MISRA C Rule 17.7 states: "The value returned by a function having
non-void return type shall be used."

The functions 'memcpy()', 'memset()', and 'memmove()' return values
primarily for convenience. The core functionality of these functions
(memory manipulation) remains unaffected, and their return values
are generally non-critical and seldom relied upon. Therefore,
violations of this rule due to these functions are deemed safe.

Update 'deviations.rst' file accordingly. No functional changes.

Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@xxxxxxxx>
Reviewed-by: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
---
Changes in v3:
- changed the last sentence in wording
- added Nicola's Reviewed-by tag

Link to v2:
https://patchew.org/Xen/812b78119cee801662a31d39b556cb453aa69508.1756192362.git.dmytro._5Fprokopchuk1@xxxxxxxx/
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 7 +++++++
 docs/misra/deviations.rst                        | 8 ++++++++
 2 files changed, 15 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl 
b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 7f3fd35a33..f410eafad6 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -575,6 +575,13 @@ safe."
 -config=MC3A2.R17.7,calls+={safe, "any()", 
"decl(name(__builtin_memcpy||__builtin_memmove||__builtin_memset||cpumask_check))"}
 -doc_end
 
+-doc_begin="The functions 'memcpy()', 'memset()', and 'memmove()' return 
values primarily for convenience.
+The core functionality of these functions (memory manipulation) remains 
unaffected, and their return values
+are generally non-critical and seldom relied upon. Therefore, violations of 
this rule due to these functions
+are deemed safe."
+-config=MC3A2.R17.7,calls+={safe, "any()", 
"decl(name(memcpy||memset||memmove))"}
+-doc_end
+
 #
 # Series 18.
 #
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index 2119066531..8e086d989f 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -576,6 +576,14 @@ Deviations related to MISRA C:2012 Rules:
          - __builtin_memset()
          - cpumask_check()
 
+   * - R17.7
+     - The functions 'memcpy()', 'memset()', and 'memmove()' return values
+       primarily for convenience. The core functionality of these functions
+       (memory manipulation) remains unaffected, and their return values are
+       generally non-critical and seldom relied upon. Therefore, violations
+       of this rule due to these functions are deemed safe.
+     - Tagged as `safe` for ECLAIR.
+
    * - R18.2
      - Subtractions between pointers where at least one of the operand is a
        pointer to a symbol defined by the linker are safe.
-- 
2.43.0



 


Rackspace

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