+2018-09-05 Tom Tromey <tom@tromey.com>
+
+ * warning.m4 (AM_GDB_WARNINGS): Add -Wformat when testing
+ -Wformat-nonliteral.
+ * target-float.c (host_float_ops<T>::to_string)
+ (host_float_ops<T>::from_string): Use
+ DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL.
+ * configure: Rebuild.
+
2018-09-05 Simon Marchi <simon.marchi@ericsson.com>
* printcmd.c (printf_c_string): Use
build_warnings="$build_warnings -Wno-unknown-pragmas"
# Solaris 11 <unistd.h> marks vfork deprecated.
build_warnings="$build_warnings -Wno-deprecated-declarations" ;;
- *) build_warnings="$build_warnings -Wformat-nonliteral" ;;
+ *)
+ # Note that gcc requires -Wformat for -Wformat-nonliteral to work,
+ # but there's a special case for this below.
+ build_warnings="$build_warnings -Wformat-nonliteral" ;;
esac
# Check whether --enable-build-warnings was given.
case $w in
-Wno-*)
wtest=`echo $w | sed 's/-Wno-/-W/g'` ;;
+ -Wformat-nonliteral)
+ # gcc requires -Wformat before -Wformat-nonliteral
+ # will work, so stick them together.
+ w="-Wformat $w"
+ wtest="$w"
+ ;;
*)
wtest=$w ;;
esac
+2018-09-05 Tom Tromey <tom@tromey.com>
+
+ * configure: Rebuild.
+
2018-08-28 Simon Marchi <simon.marchi@polymtl.ca>
PR build/23399
build_warnings="$build_warnings -Wno-unknown-pragmas"
# Solaris 11 <unistd.h> marks vfork deprecated.
build_warnings="$build_warnings -Wno-deprecated-declarations" ;;
- *) build_warnings="$build_warnings -Wformat-nonliteral" ;;
+ *)
+ # Note that gcc requires -Wformat for -Wformat-nonliteral to work,
+ # but there's a special case for this below.
+ build_warnings="$build_warnings -Wformat-nonliteral" ;;
esac
# Check whether --enable-build-warnings was given.
case $w in
-Wno-*)
wtest=`echo $w | sed 's/-Wno-/-W/g'` ;;
+ -Wformat-nonliteral)
+ # gcc requires -Wformat before -Wformat-nonliteral
+ # will work, so stick them together.
+ w="-Wformat $w"
+ wtest="$w"
+ ;;
*)
wtest=$w ;;
esac
T host_float;
from_target (type, addr, &host_float);
+
+ DIAGNOSTIC_PUSH
+ DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL
return string_printf (host_format.c_str (), host_float);
+ DIAGNOSTIC_POP
}
/* Parse string IN into a target floating-number of type TYPE and
scan_format += scanf_length_modifier<T>::value;
scan_format += "g%n";
+ DIAGNOSTIC_PUSH
+ DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL
num = sscanf (in.c_str (), scan_format.c_str(), &host_float, &n);
+ DIAGNOSTIC_POP
/* The sscanf man page suggests not making any assumptions on the effect
of %n on the result, so we don't.
build_warnings="$build_warnings -Wno-unknown-pragmas"
# Solaris 11 <unistd.h> marks vfork deprecated.
build_warnings="$build_warnings -Wno-deprecated-declarations" ;;
- *) build_warnings="$build_warnings -Wformat-nonliteral" ;;
+ *)
+ # Note that gcc requires -Wformat for -Wformat-nonliteral to work,
+ # but there's a special case for this below.
+ build_warnings="$build_warnings -Wformat-nonliteral" ;;
esac
AC_ARG_ENABLE(build-warnings,
case $w in
-Wno-*)
wtest=`echo $w | sed 's/-Wno-/-W/g'` ;;
+ -Wformat-nonliteral)
+ # gcc requires -Wformat before -Wformat-nonliteral
+ # will work, so stick them together.
+ w="-Wformat $w"
+ wtest="$w"
+ ;;
*)
wtest=$w ;;
esac