fix(toolchains): Add -Wstrict-aliasing compiler option
Add the -Wstrict-aliasing=1 compiler option and fixes errors
related to it.
Fixes #34
Change-Id: Ie2f7821d56b0cb0185c614aa916d8c9756148507
Signed-off-by: Jacob Man Chun Yiu <jacobmanchun.yiu@arm.com>
diff --git a/toolchains/common.cmake b/toolchains/common.cmake
index c3eb449..d099c5b 100644
--- a/toolchains/common.cmake
+++ b/toolchains/common.cmake
@@ -20,7 +20,7 @@
string(APPEND CMAKE_${language}_FLAGS_INIT "-Wno-type-limits ")
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 ")
+ string(APPEND CMAKE_${language}_FLAGS_DEBUG_INIT "-Og -Wnull-dereference -Wstrict-aliasing=1 ")
string(APPEND CMAKE_${language}_FLAGS_RELEASE_INIT "-g ")
endforeach()