فهرست منبع

Reduce GCC compiler spam from -Wcast-function-type

Bryan Drewery 8 سال پیش
والد
کامیت
ad65c70fe0
3فایلهای تغییر یافته به همراه59 افزوده شده و 0 حذف شده
  1. 1 0
      build/autotools/configure.ac
  2. 57 0
      configure
  3. 1 0
      doc/UPDATES.md

+ 1 - 0
build/autotools/configure.ac

@@ -34,6 +34,7 @@ fi
 CXX_FLAG_CHECK([CXXFLAGS], [-fcolor-diagnostics], [colordiagnostics])
 #CXX_FLAG_CHECK([CXXFLAGS], [-Qunused-arguments], [unusedarguments])
 CXX_FLAG_CHECK_NO([CXXFLAGS], [-Winvalid-source-encoding], [-Wno-invalid-source-encoding], [invalid_source_encoding])
+CXX_FLAG_CHECK_NO([CXXFLAGS], [-Wcast-function-type], [-Wno-cast-function-type], [no_cast_function_type])
 CXX_FLAG_CHECK([CXXFLAGS], [-fstack-protector], [stackprotector])
 CXX_FLAG_CHECK([CXXFLAGS], [-fstack-protector-strong], [stackprotectorstrong])
 if [[ "${ax_cv_prog_cc_stackprotectorstrong}" = "yes" ]]; then

+ 57 - 0
configure

@@ -3526,6 +3526,63 @@ EOF
   fi
 
 
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler understands -Wno-cast-function-type" >&5
+$as_echo_n "checking whether the compiler understands -Wno-cast-function-type... " >&6; }
+if ${ax_cv_prog_cc_no_cast_function_type+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+    ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+    ac_saved_flags="$CXXFLAGS"
+    CXXFLAGS="-Werror -Wcast-function-type"
+    cat build/confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end build/confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ax_cv_prog_cc_no_cast_function_type="yes"
+else
+  ax_cv_prog_cc_no_cast_function_type="no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    CXXFLAGS="$ac_saved_flags"
+    ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_prog_cc_no_cast_function_type" >&5
+$as_echo "$ax_cv_prog_cc_no_cast_function_type" >&6; }
+
+  if [ "$ax_cv_prog_cc_no_cast_function_type" = "yes" ]; then
+    CXXFLAGS="$CXXFLAGS -Wno-cast-function-type"
+  elif [ -n "" ]; then
+      cat << 'EOF' >&2
+configure: error:
+
+  Your OS or C++ compiler does not support -Wno-cast-function-type.
+  This compile flag is required.
+
+EOF
+    exit 1
+  fi
+
+
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler understands -fstack-protector" >&5
 $as_echo_n "checking whether the compiler understands -fstack-protector... " >&6; }
 if ${ax_cv_prog_cc_stackprotector+:} false; then :

+ 1 - 0
doc/UPDATES.md

@@ -3,6 +3,7 @@
   * Fix ptrace detection on OpenBSD (after 1.4.6 regression for the Linux fix)
   * Update server list, 'set -yes servers -' and 'set -yes servers6 -' to get new list.
   * Fix command executions.
+  * Reduce compilation spam.
 
 # 1.4.8
   * Support Debian/Ubuntu's libssl1.0.0[:i386] package.