Skip to content

Commit

Permalink
py/stackctrl: Add gcc pragmas to ignore dangling-pointer warning.
Browse files Browse the repository at this point in the history
This warning became apparent in gcc 13.

Signed-off-by: Damien George <[email protected]>
  • Loading branch information
dpgeorge authored and matejcik committed Jul 9, 2024
1 parent 32bf63b commit 5abc969
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions py/stackctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,15 @@
#include "py/stackctrl.h"

void mp_stack_ctrl_init(void) {
#if __GNUC__ >= 13
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdangling-pointer"
#endif
volatile int stack_dummy;
MP_STATE_THREAD(stack_top) = (char *)&stack_dummy;
#if __GNUC__ >= 13
#pragma GCC diagnostic pop
#endif
}

void mp_stack_set_top(void *top) {
Expand Down

0 comments on commit 5abc969

Please sign in to comment.