Currently, sparse has the attribute 'fallthrough' in its list of known-but-ignored attributes (like almost every GCC's attributes). But this attribute is a statement attribute, something which is currently not supported (it's interpreted as the attribute of an empty declaration which doesn't play well with -Wdeclaration-after-statement). Fix this by stopping to consider this attribute as known. This will allow __has_attribute(fallthrough) to correctly play its role. Note: a more complete solution will need to parse this statement attribute and maybe be able to make the distinction between statement attributes, label attributes (also currently ignored), and type, function & variable attributes. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> --- gcc-attr-list.h | 1 - 1 file changed, 1 deletion(-) diff --git a/gcc-attr-list.h b/gcc-attr-list.h index 9acb982fd..ae0b611fb 100644 --- a/gcc-attr-list.h +++ b/gcc-attr-list.h @@ -47,7 +47,6 @@ GCC_ATTR(error) GCC_ATTR(exception) GCC_ATTR(exception_handler) GCC_ATTR(externally_visible) -GCC_ATTR(fallthrough) GCC_ATTR(far) GCC_ATTR(fast_interrupt) GCC_ATTR(fastcall) -- 2.19.0