libspdm icon indicating copy to clipboard operation
libspdm copied to clipboard

Need enable compiler warning for missing default case by default.

Open jyao1 opened this issue 3 years ago • 2 comments

Related fix: #568 #567 #564

We should enable such warning treat as error by default, and catch them in CI in the future.

jyao1 avatar Jan 29 '22 02:01 jyao1

This can be achieved by enabling -Wswitch and -Wswitch-default but applying this is a bit more tricky than I expected. Currently the compile configurations are set at the main CMakeLists.txt and passed down to the crypto library's compilation step. This results in compiling the crypto library with this warning enabled as well which at least in the case of mbedtls results in errors.

We might have to decouple compiling of the crypto libraries and their build configuration from the compilation of libspdm itself and just define a dependency on a crypto library from libspdm's configuration.

ekohandel avatar Jan 31 '22 19:01 ekohandel

Agree. Crypto lib such as openssl, mbedtls can be handled later. The primary work to enforce the policy to libspdm libraries.

jyao1 avatar Feb 01 '22 03:02 jyao1