One of those “am I misreading this?” things…
The Graphviz Autotools build system enables the
-Wimplicit-fallthrough warning. This is generally a good idea, but it sprays a lot of false positives in the current build, so I thought I’d try to address this. The implementation of this feature is a bit quirky and lets you use comments or a non-standard attribute to suppress false positives. Only the former is feasible for Graphviz.
I cannot seem to achieve this with some of the fall through cases in Graphviz. E.g. line 248 of lib/sfio/sfvprintf.c looks like this currently:
247 do_star: 248 form += 1; /* fall through for '*' */ 249 case '*':
So it already has a valid suppression comment, but it’s still triggering
-Wimplicit-fallthrough warnings for me on GCC 8.3.0. Juggling line placement and comment content seem to have no effect.
Is it possible GCC ignores the suppression because it believes the control flow in this function is still problematic? For context, this region of the code contains a lot of
goto and macro usage within a multi-nested giant
switch. I cannot follow the control flow of this function, so I would be impressed if the compiler could.
Maybe the only saving grace here is that this code implements a
printf analogue, whose usage I am in the process of unwinding, so perhaps we can delete it soon.