Skip to content

Commit

Permalink
SFT-4357: Fix -Werror=dangling-pointer.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jeandudey committed Oct 31, 2024
1 parent 726b2a1 commit b072a43
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions py/stackctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit b072a43

Please sign in to comment.