From b072a4315582781c9ad8c63581de9da54d8cb429 Mon Sep 17 00:00:00 2001 From: Jean-Pierre De Jesus DIAZ Date: Thu, 31 Oct 2024 16:49:27 +0100 Subject: [PATCH] SFT-4357: Fix -Werror=dangling-pointer. Due to the update to Ubuntu 24.04 on the CI it causes this warning to be emitted, and as a result the build fails. This code takes the pointer of a variable on the stack to measure the stack usage. * py/stackctrl.c (mp_stack_usage): Disable -Wdangling-pointer warning. --- py/stackctrl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/py/stackctrl.c b/py/stackctrl.c index c2f3adb5e..46112bcbf 100644 --- a/py/stackctrl.c +++ b/py/stackctrl.c @@ -39,6 +39,7 @@ void mp_stack_set_top(void *top) { mp_uint_t mp_stack_usage(void) { // Assumes descending stack volatile int stack_dummy; +#pragma GCC diagnostic warning "-Wdangling-pointer" return MP_STATE_THREAD(stack_top) - (char *)&stack_dummy; }