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
  • Loading branch information
lhdjply authored May 27, 2024
1 parent 52c11cf commit 16444e2
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 16444e2

Please sign in to comment.