On Thu, Mar 27, 2025 at 03:33:13PM +0000, Andre Przywara wrote: > ================================================================= > This does not fully work yet, there is at least the libbz2 code > left to be handled. But this patch helps to let CI find more > places where we need annotations. > ================================================================= > > 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. > > With all places that produced warnings fixed or annotated now, we can > add this compiler option to the build flags, to find new ambiguities > early, before the code gets merged. > > Signed-off-by: Andre Przywara <andre.przyw...@arm.com> > --- > Makefile | 1 + > 1 file changed, 1 insertion(+)
For the record, once this is ready to be merged I would like to see us borrow the CC_IMPLICIT_FALLTHROUGH logic from the linux kernel (which gets the best flags for gcc or clang) instead, but yes, default to enabling the check. -- Tom
signature.asc
Description: PGP signature