make mpy-cross "-Werror=dangling-pointer=" error #12027
-
Problemuse MSYS2 to make "mpy-cross" got some error: Reasonin file ../py/stackctrl.c has this code: void mp_stack_ctrl_init(void) { Resolvechange stack_dummy declear to static variable: void mp_stack_ctrl_init(void) { |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
It is very much not correct. The MicroPython runtime (bytecode interpreter) needs to know about the C stack. If you make the variable static, it is no longer on the stack. Instead, I would use |
Beta Was this translation helpful? Give feedback.
-
i found it. |
Beta Was this translation helpful? Give feedback.
-
can you explained to me please |
Beta Was this translation helpful? Give feedback.
It is very much not correct. The MicroPython runtime (bytecode interpreter) needs to know about the C stack. If you make the variable static, it is no longer on the stack.
Instead, I would use
#pragma
to disable this check for this specific function. This is a dangling pointer, but it is intentional in this case.