aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/lib/strings/numbers.cc
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@google.com>2018-10-10 09:47:43 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-10-10 09:51:48 -0700
commitf02251190f5908d2078e9fc11b92375dfc3a3054 (patch)
tree80a0a1d4c719a190a748651f89b3aa45692afd46 /tensorflow/core/lib/strings/numbers.cc
parent828e374bfbe788a1c5ddbdbbd36149785ad6d0e6 (diff)
Correct a couple of format stringsHEADmaster
Change a couple of fscanf-style format strings to use the format macro constants defined in cinttypes. This quashes -Wformat. PiperOrigin-RevId: 216545604
Diffstat (limited to 'tensorflow/core/lib/strings/numbers.cc')
-rw-r--r--tensorflow/core/lib/strings/numbers.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/tensorflow/core/lib/strings/numbers.cc b/tensorflow/core/lib/strings/numbers.cc
index 87aa5915ff..fff6f1fedc 100644
--- a/tensorflow/core/lib/strings/numbers.cc
+++ b/tensorflow/core/lib/strings/numbers.cc
@@ -19,6 +19,7 @@ limitations under the License.
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
+#include <cinttypes>
#include <cmath>
#include <locale>
#include <unordered_map>
@@ -391,7 +392,7 @@ string FpToString(Fprint fp) {
bool StringToFp(const string& s, Fprint* fp) {
char junk;
uint64_t result;
- if (sscanf(s.c_str(), "%lx%c", &result, &junk) == 1) {
+ if (sscanf(s.c_str(), "%" SCNx64 "%c", &result, &junk) == 1) {
*fp = result;
return true;
} else {