On Wed, 2020-06-17 at 08:54 -0400, Tony Camuso wrote:
> Sorry for the noise, if this has already been reported or corrected.
> 
> tboot is built with the -Wextra Cflag, which is an alias for a
> collection of warning flags. tboot's make interprets warnings as errors.
> 
> From GCC 7 forward, the -Wextra Cflag includes -Wimplicit-fallthrough.
> 
> The GCC 7+ switch statement requires a break statement after each case.
> Without a break statement after a case, then an "implicit fallthrough"
> condition exists, where the matched case is executed, and the following
> case is also executed. If none of the fallthrough cases has a statement,
> and if the last statement in the fallthrough cascade is a break, all is
> forgiven, and the GCC 7+ compiler will move on.
> 
> Otherwise, GCC 7+ with -Wextra will issue the following error when
> -Werror is set, as it is in the tboot make.
> 
> error: this statement may fall through [-Werror=implicit-fallthrough=]
> 
> That means case statements with implicit fallthroughs will be flagged
> as compile errors and crater the build. There exists a number of
> compiler specific ways to tell the compiler that the fallthrough is
> there by design, but the simplest way to avert this problem is to add
> the -Wno-implicit-fallthrough flag to the CFLAGS_WARN variable in tboot's
> Config.mk file.
> 

Hi Tony

Thank you for your patch. This is already fixed in a6180f9e9e86. In
general we want to have -Wimplicit-fallthrough enabled, however there
was a bug where different CFLAGS value was passed to safestringlib
Makefile depends on building environment. Sometimes safestringlib was
build with -Werror -Wextra, sometimes not. [1]

Could you please check if with that commit you can build TBOOT without
errors?

[1] https://sourceforge.net/p/tboot/mailman/message/37005286/

Thanks,
Lukasz



_______________________________________________
tboot-devel mailing list
tboot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tboot-devel

Reply via email to