From 768504e956f711ef98268ac8cfca308b11fa4978 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 30 Jul 2012 11:06:48 +0200 Subject: configure.ac: enable C++ warnings --- configure.ac | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 4175e8fe2..351356282 100644 --- a/configure.ac +++ b/configure.ac @@ -21,7 +21,6 @@ dnl Programs dnl --------------------------------------------------------------------------- AC_PROG_CC_C99 AC_PROG_CXX -AC_CXX_COMPILE_STDCXX_0X AC_PROG_RANLIB AC_PROG_INSTALL @@ -110,6 +109,19 @@ if test -z "$prefix" || test "x$prefix" = xNONE; then done fi +dnl --------------------------------------------------------------------------- +dnl Language Checks +dnl --------------------------------------------------------------------------- + +AC_CXX_COMPILE_STDCXX_0X +if test "$ax_cv_cxx_compile_cxx0x_native" != yes; then + if test "$ax_cv_cxx_compile_cxx0x_gxx" = yes; then + AM_CXXFLAGS="$AM_CXXFLAGS -std=gnu++0x" + elif test "$ax_cv_cxx_compile_cxx0x_cxx" = yes; then + AM_CXXFLAGS="$AM_CXXFLAGS -std=c++0x" + fi +fi + dnl --------------------------------------------------------------------------- dnl Header/Library Checks dnl --------------------------------------------------------------------------- @@ -1487,6 +1499,17 @@ then AX_APPEND_COMPILE_FLAGS([-Wcast-qual]) AX_APPEND_COMPILE_FLAGS([-Wwrite-strings]) AX_APPEND_COMPILE_FLAGS([-pedantic]) + + AC_LANG_PUSH([C++]) + AX_APPEND_COMPILE_FLAGS([-Wall]) + AX_APPEND_COMPILE_FLAGS([-Wextra]) + AX_APPEND_COMPILE_FLAGS([-Wmissing-declarations]) + AX_APPEND_COMPILE_FLAGS([-Wshadow]) + AX_APPEND_COMPILE_FLAGS([-Wpointer-arith]) + AX_APPEND_COMPILE_FLAGS([-Wcast-qual]) + AX_APPEND_COMPILE_FLAGS([-Wwrite-strings]) + AX_APPEND_COMPILE_FLAGS([-Wsign-compare]) + AC_LANG_POP fi dnl ---------------------------- warnings as errors --------------------------- -- cgit v1.2.3