From d508979b6bde816e31caaa3cf29aeeccb60e70a2 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Mon, 15 Jun 2015 16:31:44 +0200 Subject: Add -fno-strict-aliasing to default CFLAGS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Compilation breaks with older gcc versions (gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11) on RHEL6) with the following error (due to the additional use of -Werror in the default CFLAGS) CC src/src_spice_vdagent-vdagent-x11-randr.o cc1: warnings being treated as errors src/vdagent-x11-randr.c: In function ‘vdagent_x11_randr_handle_event’: src/vdagent-x11-randr.c:499: error: dereferencing pointer ‘sce’ does break strict-aliasing rules src/vdagent-x11-randr.c:499: error: dereferencing pointer ‘sce’ does break strict-aliasing rules src/vdagent-x11-randr.c:498: note: initialized from here make: *** [src/src_spice_vdagent-vdagent-x11-randr.o] Error 1 Strict aliasing is not something we must have for the agent, and the alternative would most likely involve an anonymous union, or some casting. Given that this warning only occurs with these older compilers, better to go with a fix as non-invasive as possible. Resolves: https://bugs.freedesktop.org/show_bug.cgi?id=90981 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 37ae160..dc72bd7 100644 --- a/configure.ac +++ b/configure.ac @@ -130,7 +130,7 @@ fi # If no CFLAGS are set, set some sane default CFLAGS if test "$ac_test_CFLAGS" != set; then - DEFAULT_CFLAGS="-Wall -Werror -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4" + DEFAULT_CFLAGS="-Wall -Werror -Wp,-D_FORTIFY_SOURCE=2 -fno-strict-aliasing -fstack-protector --param=ssp-buffer-size=4" for F in $DEFAULT_CFLAGS; do AC_MSG_CHECKING([whether $CC supports $F]) save_CFLAGS="$CFLAGS" -- cgit