build: add -Wnull-dereference to Debug build
This patch adds the `-Wnull-dereference` compile option to Debug
build of RMM. It is added only to Debug build as it shows false
positives for Release build.
Change-Id: Ibf77b679d34c4f62a53296466b5957bd486988e5
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
diff --git a/toolchains/common.cmake b/toolchains/common.cmake
index 8048ca7..295bed1 100644
--- a/toolchains/common.cmake
+++ b/toolchains/common.cmake
@@ -16,7 +16,7 @@
string(APPEND CMAKE_${language}_FLAGS_INIT "-fdata-sections ")
string(APPEND CMAKE_${language}_FLAGS_INIT "-Wall -Werror ")
string(APPEND CMAKE_${language}_FLAGS_INIT "-gdwarf-4 ")
- string(APPEND CMAKE_${language}_FLAGS_DEBUG_INIT "-Og ")
+ string(APPEND CMAKE_${language}_FLAGS_DEBUG_INIT "-Og -Wnull-dereference ")
string(APPEND CMAKE_${language}_FLAGS_RELEASE_INIT "-g ")
endforeach()