From 34af4364456b9005efee3c3986ea0f4dce87c99e Mon Sep 17 00:00:00 2001 From: jcorgan Date: Sun, 24 Aug 2008 17:41:07 +0000 Subject: Fix compiler warnings across the tree. Adds --enable-warnings-as-errors configure option. Currently compiles with no warnings with GCC 4.2.3 on Ubuntu 8.04. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@9396 221aa14e-8319-0410-a670-987f0aec2ac5 --- configure.ac | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 0986a9fdb..14e982b34 100644 --- a/configure.ac +++ b/configure.ac @@ -40,6 +40,13 @@ LF_CONFIGURE_CC LF_CONFIGURE_CXX GR_LIB64 dnl check for lib64 suffix after choosing compilers +cxx_warnings_as_errors="" +AC_ARG_ENABLE( + [warnings-as-errors], + [--enable-warnings-as-errors Treat compiler warnings as errors], + [cxx_warnings_as_errors="-Werror"] +) + dnl The three macros above are known to override CXXFLAGS if the user dnl didn't specify them. Though I'm sure somebody thought this was dnl a good idea, it makes it hard to use other than -g -O2 when compiling @@ -50,16 +57,16 @@ dnl the output of swig use use -O1 if we're using g++. dnl See Makefile.common for the rest of the magic. if test "$user_set_cxxflags" != yes; then autoconf_default_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="" + CXXFLAGS=$cxx_warnings_as_errors if test "$GXX" = yes; then case "$host_cpu" in powerpc*) dnl "-O1" is broken on the PPC for some reason dnl (at least as of g++ 4.1.1) - swig_CXXFLAGS="-g1 -O2" + swig_CXXFLAGS="-g1 -O2 -fno-strict-aliasing" ;; *) - swig_CXXFLAGS="-g -O1" + swig_CXXFLAGS="-g -O1 -fno-strict-aliasing" ;; esac fi @@ -246,7 +253,7 @@ GR_SUBVERSION dnl Component specific configuration dnl The order of the GR_ macros determines the order of compilation dnl For -any- checks on $enable_all_components -dnl use the following guildlines: +dnl use the following guidelines: dnl yes : --enable-all-components was specified, so error out if any dnl components do not pass configuration checks. dnl no : --disable-all-components was specified, so try to build the -- cgit