[PATCH 02/18] zlib: annotate switch/case fallthrough cases

Tom Rini trini at konsulko.com
Mon Mar 31 18:13:36 CEST 2025


On Thu, Mar 27, 2025 at 03:32:57PM +0000, Andre Przywara wrote:

> The inflate state machine in zlib uses switch/case fall-through's
> extensively, as it sometimes advances the state, and lets the
> conveniently placed next case statement handle the new state already.
> The pattern here is:
> 		state->mode = LEN;
> 	case LEN:
> 
> Annotate those occasions with the "fallthrough;" macro, to let compilers
> know this is fine when using -Wimplicit-fallthrough.
> 
> This mimics the upstream commit 76f70abbc73f:
> Author:  Mark Adler <madler at alumni.caltech.edu>
> Date:    Sun Mar 27 00:12:38 2022 -0700
> Subject: Add fallthrough comments for gcc.
> 
> Signed-off-by: Andre Przywara <andre.przywara at arm.com>

Link: https://github.com/madler/zlib/commit/76f70abbc73f
Reviewed-by: Tom Rini <trini at konsulko.com>

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20250331/bf88542d/attachment.sig>


More information about the U-Boot mailing list