+ AC_CACHE_CHECK([whether it is safe to use -fdiagnostics-show-option],
+ [ac_cv_safe_to_use_fdiagnostics_show_option_],
+ [save_CFLAGS="$CFLAGS"
+ CFLAGS="-fdiagnostics-show-option ${CFLAGS}"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([],[])],
+ [ac_cv_safe_to_use_fdiagnostics_show_option_=yes],
+ [ac_cv_safe_to_use_fdiagnostics_show_option_=no])
+ CFLAGS="$save_CFLAGS"])
+
+ AS_IF([test "$ac_cv_safe_to_use_fdiagnostics_show_option_" = "yes"],
+ [
+ F_DIAGNOSTICS_SHOW_OPTION="-fdiagnostics-show-option"
+ ])
+
+ AC_CACHE_CHECK([whether it is safe to use -Wconversion],
+ [ac_cv_safe_to_use_wconversion_],
+ [save_CFLAGS="$CFLAGS"
+ CFLAGS="-Werror -Wconversion ${CFLAGS}"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+#include <stdbool.h>
+void foo(bool a)
+{
+ (void)a;
+}
+ ]],[[
+foo(0);
+ ]])],
+ [ac_cv_safe_to_use_wconversion_=yes],
+ [ac_cv_safe_to_use_wconversion_=no])
+ CFLAGS="$save_CFLAGS"])
+
+ AS_IF([test "$ac_cv_safe_to_use_wconversion_" = "yes"],
+ [W_CONVERSION="-Wconversion"
+ AC_CACHE_CHECK([whether it is safe to use -Wconversion with htons],
+ [ac_cv_safe_to_use_Wconversion_],
+ [save_CFLAGS="$CFLAGS"
+ CFLAGS="-Werror -Wconversion ${CFLAGS}"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <netinet/in.h>
+ ]],[[
+uint16_t x= htons(80);
+ ]])],
+ [ac_cv_safe_to_use_Wconversion_=yes],
+ [ac_cv_safe_to_use_Wconversion_=no])
+ CFLAGS="$save_CFLAGS"])
+
+ AS_IF([test "$ac_cv_safe_to_use_Wconversion_" = "no"],
+ [
+ NO_CONVERSION="-Wno-conversion"
+ ])
+ ])