aboutsummaryrefslogtreecommitdiff
path: root/gdb/target-float.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/target-float.c')
-rw-r--r--gdb/target-float.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/target-float.c b/gdb/target-float.c
index c2878cb..a12f216 100644
--- a/gdb/target-float.c
+++ b/gdb/target-float.c
@@ -948,7 +948,11 @@ host_float_ops<T>::to_string (const gdb_byte *addr, const struct type *type,
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
@@ -977,7 +981,10 @@ host_float_ops<T>::from_string (gdb_byte *addr, const struct type *type,
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.