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

[xen master] Eclair: relax long <-> function-pointer conversion deviation



commit 68c3f7fb3a840a0290ac1be76cb265bc8e7c6363
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Mon Sep 21 09:59:08 2026 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Sep 21 09:59:08 2026 +0200

    Eclair: relax long <-> function-pointer conversion deviation
    
    What is true for unsigned long is also true for plain/signed long, thus
    also taking care of two instances of __x86_return_thunk() being cast to
    long.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 8 ++++----
 docs/misra/rules.rst                             | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl 
b/automation/eclair_analysis/ECLAIR/deviations.ecl
index c087032293..670d3693d6 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -368,17 +368,17 @@ constant expressions are required.\""
 # Series 11
 #
 
--doc_begin="The conversion from a function pointer to unsigned long or (void 
*) does not lose any information, provided that the target type has enough bits 
to store it."
+-doc_begin="The conversion from a function pointer to [unsigned] long or (void 
*) does not lose any information, provided that the target type has enough bits 
to store it."
 -config=MC3A2.R11.1,casts+={safe,
   "from(type(canonical(__function_pointer_types)))
-   &&to(type(canonical(builtin(unsigned long)||pointer(builtin(void)))))
+   &&to(type(canonical(builtin(long||unsigned long)||pointer(builtin(void)))))
    &&relation(definitely_preserves_value)"
 }
 -doc_end
 
--doc_begin="Conversion from unsigned long or (void *) to a function pointer 
can restore full information, provided that the source type has enough bits to 
restore it."
+-doc_begin="Conversion from [unsigned] long or (void *) to a function pointer 
can restore full information, provided that the source type has enough bits to 
restore it."
 -config=MC3A2.R11.1,casts+={safe,
-  "from(type(canonical(builtin(unsigned long)||pointer(builtin(void)))))
+  "from(type(canonical(builtin(long||unsigned long)||pointer(builtin(void)))))
    &&to(type(canonical(__function_pointer_types)))
    &&relation(definitely_preserves_value)"
 }
diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index b174add811..c9bbab6c08 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -432,8 +432,8 @@ maintainers if you want to suggest a change.
      - All conversions to integer types are permitted if the destination
        type has enough bits to hold the entire value. Conversions to bool
        and void* are permitted. Conversions from 'void noreturn (*)(...)'
-       to 'void (*)(...)' are permitted. Conversions from unsigned long or
-       '(void *)' to a function pointer are permitted.
+       to 'void (*)(...)' are permitted. Conversions from [unsigned] long
+       or '(void *)' to a function pointer are permitted.
        Example::
 
            unsigned long func_addr = (unsigned long)&some_function;
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

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