Discovered while implementing Phase 10 of the GTK3V2MAIN quality plan (the warning ratchet, SF #661): under GCC, -Wimplicit-fallthrough is genuinely zero for owned code (only vendored app/tools/halibut/charset/iso2022.c and iso2022s.c have instances), matching what Phases 4-6 originally verified and fixed. GCC recognizes the codebase's existing fallthrough markers (comment-regex based, e.g. "/ fall through /"-style text) as valid annotations.
Clang does not recognize the same comment style by default, or recognizes a narrower pattern. Rebuilding the whole project under Clang with -Wimplicit-fallthrough enabled surfaces 115 pre-existing findings across 40 owned-code files throughout app/bin (chndldto.c, ccontrol.c, celev.c, cparalle.c, cmodify.c, cbezier.c, ccurve.c, cgroup.c, cjoin.c, cdraw.c, compound.c, csensor.c, ccornu.c, cruler.c, cselect.c, csplit.c, cturntbl.c, cstruct.c, ctrain.c, ctodesgn.c, cturnout.c, dlayer.c, ddrawprim.c, draw.c, drawgeom.c, mapwindow.c, paths.c, macro.c, tcornu.c, tbezier.c, trkendpt.c, trkseg.c, tcurve.c, tstraigh.c, track.c, form/defaultvalues.c, appmainwindow/chotbar.c, and a few more). This is a pure compiler-annotation-syntax mismatch, not real bugs -- every one of these switch statements already falls through intentionally, GCC just accepts the existing marker style and Clang doesn't.
Not fixed as part of #661/Phase 10 -- 115 instances across 40 files is too large for what was meant to be a mechanical ratchet phase, and picking the wrong portable annotation now would mean redoing all 115 sites later. Currently PlatformSettings.cmake only promotes -Werror=implicit-fallthrough under CMAKE_C_COMPILER_ID STREQUAL "GNU" (GCC), specifically to avoid breaking the Clang-based CI jobs (c-tests-linux-clang, c-tests-macos, c-tests-sanitizers) on this pre-existing gap.
Fix: standardize on a single fallthrough annotation both GCC and Clang recognize -- the C23 [[fallthrough]] attribute (if the project's C standard target supports it) or the portable attribute((fallthrough)) macro pattern (GCC >= 7, Clang >= 3.5, both already the project's minimum supported versions) -- across all 115 sites, then drop the GCC-only guard so implicit-fallthrough becomes universally ratcheted like the other four categories.
Anonymous