From 9bb82592eba8a9f18944bb9e36e0aba0fd6f55f5 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Fri, 20 Jan 2017 12:15:11 +0200 Subject: [PATCH] Fix disabling of -Werror in PGAC_PROG_CXX_CXXFLAGS_OPT macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was copy-pasted from PGAC_PROG_CC_CFLAGS_OPT, but for the g++ compiler, we need to set ac_cxx_werror rather than ac_c_werror. The point of this dance with Werror is to detect if the compiler accepts a flags, but causes warnings, like: cc1plus: warning: command line option ‘-Wmissing-prototypes’ is valid for C/ObjC but not for C++ We don't want to use such a flag. --- config/cxx-compiler.m4 | 6 +++--- configure | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config/cxx-compiler.m4 b/config/cxx-compiler.m4 index 4715259a49..a0b9619076 100644 --- a/config/cxx-compiler.m4 +++ b/config/cxx-compiler.m4 @@ -6,13 +6,13 @@ AC_DEFUN([PGAC_PROG_CXX_CXXFLAGS_OPT], [AC_MSG_CHECKING([if $CXX supports $1]) pgac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="$pgac_save_CXXFLAGS $1" -ac_save_c_werror_flag=$ac_c_werror_flag -ac_c_werror_flag=yes +ac_save_cxx_werror_flag=$ac_cxx_werror_flag +ac_cxx_werror_flag=yes AC_LANG_PUSH([C++]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT(yes), [CXXFLAGS="$pgac_save_CXXFLAGS" AC_MSG_RESULT(no)]) AC_LANG_POP([C++]) -ac_c_werror_flag=$ac_save_c_werror_flag +ac_cxx_werror_flag=$ac_save_cxx_werror_flag ])# PGAC_PROG_CXX_CXXFLAGS_OPT diff --git a/configure b/configure index e9bb937c86..e22b747e7e 100755 --- a/configure +++ b/configure @@ -4990,8 +4990,8 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu $as_echo_n "checking if $CXX supports -fno-aggressive-loop-optimizations... " >&6; } pgac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="$pgac_save_CXXFLAGS -fno-aggressive-loop-optimizations" -ac_save_c_werror_flag=$ac_c_werror_flag -ac_c_werror_flag=yes +ac_save_cxx_werror_flag=$ac_cxx_werror_flag +ac_cxx_werror_flag=yes ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -5024,7 +5024,7 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_c_werror_flag=$ac_save_c_werror_flag +ac_cxx_werror_flag=$ac_save_cxx_werror_flag # Silence compiler warnings that you get with modern versions of GCC. -- GitLab