[PATCH] misra: allow using binary literals in c99 as an extension.

Nicola Vetrini posted 1 patch 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/30bb474fbb0e9236728fad9515bca4d160d594b3.1767721635.git.nicola.vetrini@bugseng.com
automation/eclair_analysis/ECLAIR/toolchain.ecl | 5 +++++
docs/misra/C-language-toolchain.rst             | 4 ++++
2 files changed, 9 insertions(+)
[PATCH] misra: allow using binary literals in c99 as an extension.
Posted by Nicola Vetrini 1 month ago
From: Nicola Vetrini <nicola.vetrini@bugseng.com>

There is consensus towards using more binary literals in Xen,
so they are enabled both for X86_64 and ARM64.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 automation/eclair_analysis/ECLAIR/toolchain.ecl | 5 +++++
 docs/misra/C-language-toolchain.rst             | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/toolchain.ecl b/automation/eclair_analysis/ECLAIR/toolchain.ecl
index 4bc88aa029..da00c2198a 100644
--- a/automation/eclair_analysis/ECLAIR/toolchain.ecl
+++ b/automation/eclair_analysis/ECLAIR/toolchain.ecl
@@ -332,3 +332,8 @@ ext_sizeof_alignof_void_type"
 -doc_begin="See Section \"4.13 Preprocessing Directives\" of "GCC_MANUAL" and Section \"11.1 Implementation-defined behavior\" of "CPP_MANUAL"."
 -config=STD.inclexpd,behavior={c99, GCC_X86_64, "specified"}
 -doc_end
+
+-doc_begin="See Section \"6.65 Binary Constants using the '0b' Prefix\" of "GCC_MANUAL"."
+-config=STD.ltrlbin,behavior={c99, GCC_ARM64, "specified"}
+-config=STD.ltrlbin,behavior={c99, GCC_X86_64, "specified"}
+-doc_end
diff --git a/docs/misra/C-language-toolchain.rst b/docs/misra/C-language-toolchain.rst
index ec0c9953be..5d418e262a 100644
--- a/docs/misra/C-language-toolchain.rst
+++ b/docs/misra/C-language-toolchain.rst
@@ -218,6 +218,10 @@ The table columns are as follows:
      - All architectures
      - See Section "6.3 Labels as Values" of GCC_MANUAL.
 
+   * - Binary constants
+     - ARM64, X86_64
+     - See Section "6.65 Binary Constants using the '0b' Prefix"
+
 Translation Limits
 __________________
 
-- 
2.52.0
Re: [PATCH] misra: allow using binary literals in c99 as an extension.
Posted by Andrew Cooper 1 month ago
On 06/01/2026 5:50 pm, Nicola Vetrini wrote:
> From: Nicola Vetrini <nicola.vetrini@bugseng.com>
>
> There is consensus towards using more binary literals in Xen,
> so they are enabled both for X86_64 and ARM64.
>
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

Thanks for looking into this.