build: add Wextra compile option
This patch add -Wextra compile option to RMM build. The
warning for implicit fallthrough is disabled as this is a
pattern used in the code. Couple of warnings triggered by
-Wextra are also fixed as part of the patch.
Change-Id: I7c0b815e5fadd3d45d4c72508df64d77f916d6d3
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
diff --git a/toolchains/common.cmake b/toolchains/common.cmake
index fe2f19c..0d6d55f 100644
--- a/toolchains/common.cmake
+++ b/toolchains/common.cmake
@@ -15,6 +15,7 @@
string(APPEND CMAKE_${language}_FLAGS_INIT "-ffunction-sections ")
string(APPEND CMAKE_${language}_FLAGS_INIT "-fdata-sections ")
string(APPEND CMAKE_${language}_FLAGS_INIT "-Wall -Werror -Wstrict-overflow ")
+ string(APPEND CMAKE_${language}_FLAGS_INIT "-Wextra -Wno-implicit-fallthrough ")
string(APPEND CMAKE_${language}_FLAGS_INIT "-gdwarf-4 ")
string(APPEND CMAKE_${language}_FLAGS_INIT "-D_FORTIFY_SOURCE=2 ")
string(APPEND CMAKE_${language}_FLAGS_DEBUG_INIT "-Og -Wnull-dereference ")