summaryrefslogtreecommitdiff
path: root/m4/cares-compilers.m4
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2010-11-18 17:11:38 +0100
committerYang Tse <yangsita@gmail.com>2010-11-18 17:11:38 +0100
commit4d44b54c75dfa0b64fcfb55362f54b54ec956059 (patch)
treea577c0a8762bc1dfca7e0a09a87c3d0358af8eda /m4/cares-compilers.m4
parent461fa89e0a5d27c462dfab4dce26d4818ec3d22f (diff)
downloadc-ares-4d44b54c75dfa0b64fcfb55362f54b54ec956059.tar.gz
c-ares-4d44b54c75dfa0b64fcfb55362f54b54ec956059.tar.bz2
c-ares-4d44b54c75dfa0b64fcfb55362f54b54ec956059.zip
configure: use autobuilds to temporarily verify strict aliasing warnings.
Temporarily, When cross-compiling with gcc 3.0 or later, enable strict aliasing rules and warnings. Given that cross-compiled targets autobuilds do not run the test-suite, there is no risk of running code that violates strict aliasing rules
Diffstat (limited to 'm4/cares-compilers.m4')
-rw-r--r--m4/cares-compilers.m45
1 files changed, 5 insertions, 0 deletions
diff --git a/m4/cares-compilers.m4 b/m4/cares-compilers.m4
index 3a57389..695c82a 100644
--- a/m4/cares-compilers.m4
+++ b/m4/cares-compilers.m4
@@ -931,6 +931,11 @@ AC_DEFUN([CARES_SET_COMPILER_WARNING_OPTS], [
dnl Also, on gcc 4.0.X it is totally unbearable and complains all
dnl over making it unusable for generic purposes. Let's not use it.
tmp_CFLAGS="$tmp_CFLAGS"
+ dnl When cross-compiling with gcc 3.0 or later,
+ dnl enable strict aliasing rules and warnings.
+ if test "x$cross_compiling" = "xyes"; then
+ tmp_CFLAGS="$tmp_CFLAGS -fstrict-aliasing -Wstrict-aliasing=2"
+ fi
fi
#
dnl Only gcc 3.3 or later