-
Notifications
You must be signed in to change notification settings - Fork 7.6k
zephyr: sw_isr_table: Fix compilation error #92336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
520d877
to
cbd2158
Compare
The IRQ_DIRECT_CONNECT macro eventually uses _Z_ISR_DIRECT_TABLE_ENTRY, which defines a function. IRQ_DIRECT_CONNECT is meant to be used inside functions. While nested functions are supported as an extension in GNU C, the nested function cannot have static storage. https://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html: > A nested function always has no linkage. Declaring one with extern or > static is erroneous. ./scripts/twister -c -s arch.interrupt.gen_isr_table_local.riscv --all tests/kernel/gen_isr_table/src/main.c: In function 'gen_isr_table_test_build_time_direct_interrupt': include/zephyr/sw_isr_table.h:197:41: error: invalid storage class for function '__isr_table_entry_isr1_irq_2' #define __MK_ISR_ELEMENT_NAME(func, id) __isr_table_entry_ ## func ## _irq_ ## id ^~~~~~~~~~~~~~~~~~ Issue zephyrproject-rtos#92194 Signed-off-by: Tom Hughes <tomhughes@chromium.org>
cbd2158
to
cd0f613
Compare
static void __attribute__((section(sect))) __attribute__((naked)) \ | ||
__used _MK_IRQ_ELEMENT_NAME(func, __COUNTER__)(void) { \ | ||
void __attribute__((section(sect))) __attribute__((naked)) \ | ||
/* clang-format off */ \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to turn off clang-format
here because it wanted to make line 248 and 249 a single line, which breaks the other check that lines are shorter than 100 characters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good thing, that clang-format isn't mandatory
|
The IRQ_DIRECT_CONNECT macro eventually uses _Z_ISR_DIRECT_TABLE_ENTRY,
which defines a function. IRQ_DIRECT_CONNECT is meant to be used
inside functions. While nested functions are supported as an extension
in GNU C, the nested function cannot have static storage.
https://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html:
Issue #92194