py/stackctrl: Add gcc pragmas to ignore dangling-pointer warning.

This commit is contained in:
lhdjply 2024-05-27 09:41:50 +08:00 committed by GitHub
parent 52c11cf4e0
commit 16444e222d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -28,8 +28,15 @@
#include "py/stackctrl.h" #include "py/stackctrl.h"
void mp_stack_ctrl_init(void) { void mp_stack_ctrl_init(void) {
#if __GNUC__ >= 13
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdangling-pointer"
#endif
volatile int stack_dummy; volatile int stack_dummy;
MP_STATE_THREAD(stack_top) = (char *)&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) { void mp_stack_set_top(void *top) {