From 9debd59368d411b3cedd353a4670a9be2d1d8e97 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Tue, 29 Jun 2021 11:07:38 -0700 Subject: [PATCH] tests: schedule_api: use stack array extern macro The stack array tstacks was declared in the header file using the same macro which defines the same stack array but with an added "extern" in front. This macro adds alignment and section attribute which are actually not the same as the actual stack array defined in main.c. The section name used in the section attribute contains the file name where the stack array is defined or extern declared. So the same symbol, in this case z_interrupt_stacks, has different attributes in two places, and GCC 11 starts to complain about this. So use the newly introduced macro to extern declare the stack array without adding/replacing any symbol attributes. Signed-off-by: Daniel Leung --- tests/kernel/sched/schedule_api/src/test_sched.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/kernel/sched/schedule_api/src/test_sched.h b/tests/kernel/sched/schedule_api/src/test_sched.h index 094865cb2c2..3b33f18051a 100644 --- a/tests/kernel/sched/schedule_api/src/test_sched.h +++ b/tests/kernel/sched/schedule_api/src/test_sched.h @@ -14,7 +14,7 @@ #define STACK_SIZE (640 + CONFIG_TEST_EXTRA_STACKSIZE) K_THREAD_STACK_EXTERN(tstack); -extern K_THREAD_STACK_ARRAY_DEFINE(tstacks, MAX_NUM_THREAD, STACK_SIZE); +K_THREAD_STACK_ARRAY_EXTERN(tstacks, MAX_NUM_THREAD, STACK_SIZE); extern struct k_thread user_thread; extern struct k_sem user_sem;