+ [AC_LANG_PROGRAM([],[])],
+ [ac_cv_safe_to_use_floop_parallelize_all_=yes],
+ [ac_cv_safe_to_use_floop_parallelize_all_=no])
+ CFLAGS="$save_CFLAGS"])
+
+ AS_IF([test "$ac_cv_safe_to_use_floop_parallelize_all_" = "yes"],
+ [
+ F_LOOP_PARALLELIZE_ALL="-floop-parallelize-all"
+ ])
+
+ NO_STRICT_ALIASING="-fno-strict-aliasing -Wno-strict-aliasing"
+ NO_SHADOW="-Wno-shadow"
+
+ AS_IF([test "$INTELCC" = "yes"],[
+ m4_if(PW_LESS_WARNINGS,[no],[
+ BASE_WARNINGS="-w1 -Werror -Wcheck -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 188"
+ ],[
+ dnl 2203 is like old-style-cast
+ dnl 1684 is like strict-aliasing
+ dnl 188 is about using enums as bitfields
+ dnl 1683 is a warning about _EXPLICIT_ casting, which we want
+ BASE_WARNINGS="-w1 -Werror -Wcheck -Wp64 -Woverloaded-virtual -Wcast-qual -diag-disable 188,981,2259,2203,1683,1684"
+ ])
+ CC_WARNINGS="${BASE_WARNINGS}"
+ CXX_WARNINGS="${BASE_WARNINGS}"
+ PROTOSKIP_WARNINGS="-diag-disable 188,981,967,2259,1683,1684,2203"
+
+ ],[
+ m4_if(PW_LESS_WARNINGS,[no],[
+ BASE_WARNINGS_FULL="${W_CONVERSION} -Wstrict-aliasing -Wswitch-enum "
+ CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum -Wwrite-strings"
+ CXX_WARNINGS_FULL=""
+ NO_OLD_STYLE_CAST="-Wno-old-style-cast"
+ NO_EFF_CXX="-Wno-effc++"
+ ],[
+ BASE_WARNINGS_FULL="${NO_STRICT_ALIASING}"
+ ])
+
+ AS_IF([test "${ac_cv_assert}" = "no"],
+ [NO_UNUSED="-Wno-unused-variable -Wno-unused-parameter"])
+
+ AC_CACHE_CHECK([whether it is safe to use -Wextra],
+ [ac_cv_safe_to_use_Wextra_],
+ [save_CFLAGS="$CFLAGS"
+ CFLAGS="${W_FAIL} -pedantic -Wextra ${AM_CFLAGS} ${CFLAGS}"
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM(
+ [[
+#include <stdio.h>
+ ]], [[]])
+ ],
+ [ac_cv_safe_to_use_Wextra_=yes],
+ [ac_cv_safe_to_use_Wextra_=no])
+ CFLAGS="$save_CFLAGS"])
+
+ BASE_WARNINGS="${W_FAIL} -pedantic -Wall -Wundef -Wshadow -Wparentheses ${NO_UNUSED} ${F_DIAGNOSTICS_SHOW_OPTION} ${F_LOOP_PARALLELIZE_ALL} ${BASE_WARNINGS_FULL}"
+ AS_IF([test "$ac_cv_safe_to_use_Wextra_" = "yes"],
+ [BASE_WARNINGS="${BASE_WARNINGS} -Wextra"],
+ [BASE_WARNINGS="${BASE_WARNINGS} -W"])
+
+ AC_CACHE_CHECK([whether it is safe to use -Wformat],
+ [ac_cv_safe_to_use_wformat_],
+ [save_CFLAGS="$CFLAGS"
+ dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
+ dnl conversion warnings to all the tarball folks
+ CFLAGS="-Wformat -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+#include <stdio.h>
+#include <stdint.h>
+#include <inttypes.h>
+void foo();
+void foo()
+{
+ uint64_t test_u= 0;
+ printf("This is a %" PRIu64 "test\n", test_u);
+}
+ ]],[[
+foo();
+ ]])],
+ [ac_cv_safe_to_use_wformat_=yes],
+ [ac_cv_safe_to_use_wformat_=no])
+ CFLAGS="$save_CFLAGS"])
+ AS_IF([test "$ac_cv_safe_to_use_wformat_" = "yes"],[
+ BASE_WARNINGS="${BASE_WARNINGS} -Wformat -Wno-format-nonliteral -Wformat-security"
+ BASE_WARNINGS_FULL="${BASE_WARNINGS_FULL} -Wformat=2 -Wno-format-nonliteral -Wformat-security"
+ ],[
+ BASE_WARNINGS="${BASE_WARNINGS} -Wno-format"
+ BASE_WARNINGS_FULL="${BASE_WARNINGS_FULL} -Wno-format"
+ ])
+
+
+
+ AC_CACHE_CHECK([whether it is safe to use -Wconversion],
+ [ac_cv_safe_to_use_wconversion_],
+ [save_CFLAGS="$CFLAGS"
+ dnl Use -Werror here instead of ${W_FAIL} so that we don't spew
+ dnl conversion warnings to all the tarball folks
+ CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS} ${CFLAGS}"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[