Disable strict-aliasing globally
[lttng-ust.git] / configure.ac
index cf2e0e3e75f04d18dbc85fff2781c7203e60238b..66e07f7f2a2f91dddea213ffe20344b947b65344 100644 (file)
@@ -179,6 +179,11 @@ AC_LANG_POP([C])
 # Clang >= 3.3 (required by the project) and are only valid for C code.
 WARN_CFLAGS="${WARN_CFLAGS} -Wold-style-definition -Wstrict-prototypes"
 
+# Disable 'strict aliasing' if the compiler supports it.
+AC_LANG_PUSH([C])
+AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing], [OPT_CFLAGS], [-Werror])
+AC_LANG_POP([C])
+
 
 ##                     ##
 ## C++ compiler checks ##
@@ -544,7 +549,7 @@ AC_SUBST([LTTNG_UST_CTL_LIBRARY_VERSION], ust_ctl_lib_version)
 # Major soname for python-lttngust
 AC_SUBST([LTTNG_UST_LIB_SONAME_MAJOR], [ust_lib_version_current])
 
-AM_CFLAGS="$WARN_CFLAGS $URCU_CFLAGS $PTHREAD_CFLAGS"
+AM_CFLAGS="$OPT_CFLAGS $WARN_CFLAGS $URCU_CFLAGS $PTHREAD_CFLAGS"
 AC_SUBST(AM_CFLAGS)
 
 AM_CXXFLAGS="$WARN_CXXFLAGS $URCU_CFLAGS $PTHREAD_CFLAGS"
This page took 0.024894 seconds and 4 git commands to generate.