mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-11 15:34:55 +00:00
![]() Andre Przywara <andre.przywara@arm.com> says: C's implicit fallthrough behaviour in switch/case statements can lead to subtle bugs. Quite some while ago many compilers introduced warnings in those cases, requiring intentional fallthrough's to be annotated. So far we were not enabling that compiler option, so many ambiguities and some bugs in the code went unnoticed. This series adds the required annotations in code paths that the first stage of the U-Boot CI covers. There is a large number of cases left in the libbz2 code. The usage of switch/case is borderline insane there, labels are hidden in macros, and there are no breaks, but just goto's. Upstream still uses very similar code, without any annotations. I still am not 100% sure those are meant to fall through or not, and plan to do further investigations, but didn't want to hold the rest of the patches back. You can see for yourself by applying patch 18/18 and building for sandbox64, for instance. Because of this we cannot quite enable the warning in the Makefile yet, but those fixes are worth regardless, and be it to increase readability. Please note that those patches do not fix anything, really, they just add those fallthrough annotations, so the series is not really critical. Link: https://lore.kernel.org/r/20250327153313.2105227-1-andre.przywara@arm.com |
||
---|---|---|
.. | ||
Kconfig | ||
Kconfig.nxp | ||
Kconfig.tpl | ||
Kconfig.vpl | ||
Makefile | ||
spl.c | ||
spl_atf.c | ||
spl_blk_fs.c | ||
spl_bootrom.c | ||
spl_dfu.c | ||
spl_ext.c | ||
spl_fat.c | ||
spl_fit.c | ||
spl_imx_container.c | ||
spl_legacy.c | ||
spl_mmc.c | ||
spl_nand.c | ||
spl_net.c | ||
spl_nor.c | ||
spl_nvme.c | ||
spl_onenand.c | ||
spl_opensbi.c | ||
spl_optee.S | ||
spl_ram.c | ||
spl_reloc.c | ||
spl_sata.c | ||
spl_sdp.c | ||
spl_semihosting.c | ||
spl_spi.c | ||
spl_ubi.c | ||
spl_upl.c | ||
spl_usb.c | ||
spl_xip.c | ||
spl_ymodem.c |