[vlc-devel] [PATCH] m4: fix c++ check for -f flags

Filip Roséen filip at atch.se
Thu Feb 23 14:54:17 CET 2017


Both gcc and clang generate warnings for unsupported -f$FLAG by
default, meaning that the previous implementation would consider
unsupported flags as supported (as a warning is not an error that
fails compilation).

The addition of -Werror treats warnings as errors, and will prevent
false-positives in terms of -f$FLAG support.

--

This is already done for the equivalent function for CC check.
---
 m4/flags.m4 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/m4/flags.m4 b/m4/flags.m4
index 0a5c7c923f..0907f3b076 100644
--- a/m4/flags.m4
+++ b/m4/flags.m4
@@ -48,7 +48,7 @@ AC_DEFUN([RDC_PROG_CXX_FLAGS_IFELSE],
   CXXFLAGS_save="${CXXFLAGS}"
   as_ac_var=`echo "ac_cv_prog_cxx_flags_$1" | $as_tr_sh`
   AC_CACHE_CHECK([if $CXX accepts $1], [$as_ac_var], [
-    CXXFLAGS="${CXXFLAGS} $1"
+    CXXFLAGS="${CXXFLAGS} -Werror $1"
     AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
       eval "$as_ac_var=yes"
     ],[
-- 
2.11.1



More information about the vlc-devel mailing list