micropython: fix stackctrl compilation for GCC 13 21765/head
authorJean-Paul Etienne <fractalclone@gmail.com>
Sat, 5 Aug 2023 22:13:10 +0000 (00:13 +0200)
committerJean-Paul Etienne <fractalclone@gmail.com>
Tue, 8 Aug 2023 13:38:50 +0000 (15:38 +0200)
commit5abd8a9fe6a6f1d31ba55ba9bf97f1223506262d
tree443a3ce4a43f833b778cb25ad8ef46dc91c45171
parentb036e052b48ec9ebd0164a2723e0d09cd3dde9b7
micropython: fix stackctrl compilation for GCC 13

On host PC using GCC 13, stackctrl.c fails to compile
with the following error:

../py/stackctrl.c: In function 'mp_stack_ctrl_init':
../py/stackctrl.c:32:32: error: storing the address of
   local variable 'stack_dummy'
   in 'mp_state_ctx.thread.stack_top' [-Werror=dangling-pointer=]
   32 |     MP_STATE_THREAD(stack_top) = (char *)&stack_dummy;
../py/stackctrl.c:31:18: note: 'stack_dummy' declared here
   31 |     volatile int stack_dummy;
      |                  ^~~~~~~~~~~
In file included from ../py/runtime.h:29,
                 from ../py/stackctrl.c:27:
../py/mpstate.h:296:23: note: 'mp_state_ctx' declared here
  296 | extern mp_state_ctx_t mp_state_ctx;
      |                       ^~~~~~~~~~~~
cc1: all warnings being treated as errors

Fixed accordingly by ignoring -dangling-pointer warning
inside mp_stack_ctrl_init function.

Signed-off-by: Jean-Paul Etienne <fractalclone@gmail.com>
(cherry picked from commit 4c1b74ede3a1d8c5b8b1594a01a2048325ee6c23)
lang/python/micropython/patches/050-py-stackctrl-fix-gcc-13.patch [new file with mode: 0644]