RTEMS | irq-record.c and Indexing past end of arriy (#5298)
Joel Sherrill (@joel)
gitlab at rtems.org
Sat Jul 12 18:14:53 UTC 2025
Joel Sherrill created an issue: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5298
Assignee: Sebastian Huber
## Summary
This warning occurs in multiple BSPs:
```
../../../bsps/shared/irq/irq-record.c: In function 'bsp_interrupt_get_dispatch_table_slot':
../../../bsps/shared/irq/irq-record.c:56:10: warning: array subscript index is outside array bounds of 'rtems_interrupt_entry *[0]' [-Warray-bounds=]
56 | return &_Record_Interrupt_dispatch_table[ index ];
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../bsps/shared/irq/irq-record.c:43:1: note: while referencing '_Record_Interrupt_dispatch_table'
43 | _Record_Interrupt_dispatch_table[ BSP_INTERRUPT_DISPATCH_TABLE_SIZE ];
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../bsps/shared/irq/irq-generic.c: In function 'bsp_interrupt_get_dispatch_table_slot':
../../../bsps/shared/irq/irq-generic.c:53:10: warning: array subscript index is outside array bounds of 'rtems_interrupt_entry *[0]' [-Warray-bounds=]
53 | return &bsp_interrupt_dispatch_table[ index ];
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../bsps/shared/irq/irq-generic.c:47:1: note: while referencing 'bsp_interrupt_dispatch_table'
47 | bsp_interrupt_dispatch_table[ BSP_INTERRUPT_DISPATCH_TABLE_SIZE ];
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
I see this warning in the following BSPS:
- m68k/av5282
- m68k/mcf5235
- m68k/mcf5329
- m68k/uC5282
- moxie/moxiesim
- powerpc/beatnik
- powerpc/mvme3100
- powerpc/mvme5500
- powerpc/ss555
- powerpc/virtex4
- powerpc/virtex5
## Steps to reproduce
Build and look for warnings
### Pre-set options
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5298
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20250712/6458a2d7/attachment-0001.htm>
More information about the bugs
mailing list