summaryrefslogtreecommitdiffstatshomepage
path: root/shared/runtime
diff options
context:
space:
mode:
authorAlessandro Gatti <a.gatti@frob.it>2024-11-18 22:00:31 +0100
committerDamien George <damien@micropython.org>2024-12-10 12:03:34 +1100
commit5784714f734caf3713ff880ffe100bbbec59216e (patch)
treed104ea4ed32554cc6dc54b5db6451eda256f95e2 /shared/runtime
parent0f7d68043fce3c305ad68cba06e4126628048f3e (diff)
downloadmicropython-5784714f734caf3713ff880ffe100bbbec59216e.tar.gz
micropython-5784714f734caf3713ff880ffe100bbbec59216e.zip
shared/runtime/gchelper_generic: Fix AArch32 build on Clang.
This commit fixes a compile error happening on Clang when building the generic gchelper code for AArch32. Clang would raise a warning regarding undefined variable access when aliasing a variable to an existing CPU register. The fix is pretty crude but it works - it simply disables the warning in question for the AArch32 gchelper collection function. Care was taken to make sure the code would also compile on GCC without warnings of sorts. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
Diffstat (limited to 'shared/runtime')
-rw-r--r--shared/runtime/gchelper_generic.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/shared/runtime/gchelper_generic.c b/shared/runtime/gchelper_generic.c
index 0937231374..45b2e4f7d8 100644
--- a/shared/runtime/gchelper_generic.c
+++ b/shared/runtime/gchelper_generic.c
@@ -101,6 +101,10 @@ static void gc_helper_get_regs(gc_helper_regs_t arr) {
// Fallback implementation, prefer gchelper_thumb1.s or gchelper_thumb2.s
static void gc_helper_get_regs(gc_helper_regs_t arr) {
+ #ifdef __clang__
+ #pragma clang diagnostic push
+ #pragma clang diagnostic ignored "-Wuninitialized"
+ #endif
register long r4 asm ("r4");
register long r5 asm ("r5");
register long r6 asm ("r6");
@@ -121,6 +125,9 @@ static void gc_helper_get_regs(gc_helper_regs_t arr) {
arr[7] = r11;
arr[8] = r12;
arr[9] = r13;
+ #ifdef __clang__
+ #pragma clang diagnostic pop
+ #endif
}
#elif defined(__aarch64__)