Commit d7891d091314769715efc9afad4dbd63694b1898

Ran Benita 2018-08-18T15:12:15

build: turn off strict aliasing The benchmarks don't show any effect, so turn it off to have one less thing to worry about. The parser does a lot of casting between AST nodes. Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/configure.ac b/configure.ac
index e4dd960..eaeb553 100644
--- a/configure.ac
+++ b/configure.ac
@@ -83,7 +83,7 @@ AX_GCC_BUILTIN(__builtin_popcount)
 AC_CHECK_HEADER([linux/input.h])
 AM_CONDITIONAL(BUILD_LINUX_TESTS, [test "x$ac_cv_header_linux_input_h" = xyes])
 
-XORG_TESTSET_CFLAG([BASE_CFLAGS], [-fvisibility=hidden])
+XORG_TESTSET_CFLAG([BASE_CFLAGS], [-fvisibility=hidden -fno-strict-aliasing -fsanitize-undefined-trap-on-error])
 XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wextra -Wno-unused-parameter -Wno-missing-field-initializers])
 XORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wdocumentation -Wno-documentation-deprecated-sync])
 
diff --git a/meson.build b/meson.build
index 87193dd..92a7cb8 100644
--- a/meson.build
+++ b/meson.build
@@ -16,6 +16,8 @@ cc = meson.get_compiler('c')
 # Compiler flags.
 foreach cflag: [
     '-fvisibility=hidden',
+    '-fno-strict-aliasing',
+    '-fsanitize-undefined-trap-on-error',
     '-Wextra',
     '-Wno-unused-parameter',
     '-Wno-missing-field-initializers',
@@ -31,7 +33,6 @@ foreach cflag: [
     '-Wdate-time',
     '-Wwrite-strings',
     '-Wno-documentation-deprecated-sync',
-    '-fsanitize-undefined-trap-on-error',
 ]
     if cc.has_argument(cflag)
         add_project_arguments(cflag, language: 'c')