]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
libxfs: hide the drainbamaged fallthrough macro from xfslibs
authorDarrick J. Wong <djwong@kernel.org>
Mon, 6 Dec 2021 19:26:04 +0000 (14:26 -0500)
committerEric Sandeen <sandeen@sandeen.net>
Mon, 6 Dec 2021 19:26:04 +0000 (14:26 -0500)
commit135ce1ed0a9944c3704d312fc844b845aa5c8686
treea2e70e1f01f1f896e7f08ebe2ae02d574fb3c750
parent0e0de3669c37deee975002bb9c8d6771305bdeb2
libxfs: hide the drainbamaged fallthrough macro from xfslibs

Back in mid-2021, Kees and Gustavo rammed into the kernel a bunch of
static checker "improvements" that redefined '/* fallthrough */'
comments for switch statements as a macro that virtualizes either that
same comment, a do-while loop, or a compiler __attribute__.  This was
necessary to work around the poor decision-making of the clang, gcc, and
C language standard authors, who collectively came up with four mutually
incompatible ways to document a lack of branching in a code flow.

Having received ZERO HELP porting this to userspace, Eric and I
foolishly dumped that crap into linux.h, which was a poor decision
because we keep forgetting that linux.h is exported as a userspace
header.  This has now caused downstream regressions in Debian[1] and
will probably cause more problems in the other distros.

Move it to platform_defs.h since that's not shipped publicly and leave a
warning to anyone else who dare modify linux.h.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1000974

Fixes: df9c7d8d ("xfs: Fix fall-through warnings for Clang")
Cc: 1000974@bugs.debian.org, gustavoars@kernel.org, keescook@chromium.org
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
[sandeen: add comment to top of linux.h  per Dave's suggestion]
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
include/linux.h
include/platform_defs.h.in