From fc8dff77e74ce07a818bcea28329ca0115e5c663 Mon Sep 17 00:00:00 2001
From: ls232920 <laurent.soulier@cea.fr>
Date: Tue, 26 Sep 2023 17:36:24 +0000
Subject: [PATCH] [WIP][NF][BUILD] adding strict aliasing compiler option (the
 warning option might be ignored by clang)

---
 CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f65c32016..bc9ec7200 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -74,7 +74,7 @@ endif()
 
     target_compile_options(${module_name} PRIVATE
     $<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:
-    -Wall -Wextra -fPIC -Wold-style-cast -Winline -pedantic -Werror=narrowing -Wshadow $<$<BOOL:${WERROR}>:-Werror> ${SANITIZE_FLAGS}>)
+    -Wall -Wextra -fPIC -Wold-style-cast -Winline -pedantic -Werror=narrowing -Wshadow -fstrict-aliasing -Wstrict-aliasing=1 $<$<BOOL:${WERROR}>:-Werror> ${SANITIZE_FLAGS}>)
     target_compile_options(${module_name} PRIVATE
     $<$<CXX_COMPILER_ID:MSVC>:
     /W4>)
-- 
GitLab