summaryrefslogtreecommitdiff
path: root/src/emscripten-optimizer
diff options
context:
space:
mode:
authorJF Bastien <jfb@chromium.org>2015-12-22 11:43:20 -0800
committerJF Bastien <jfb@chromium.org>2015-12-22 11:43:20 -0800
commitdc9f3977561017924e08a8f87727f1ee1bcf8f97 (patch)
tree0f84461b75c6b675d783dab128a28abaa77cbcd3 /src/emscripten-optimizer
parent8794a809838ba609400f7f8c5d41571700cbf289 (diff)
downloadbinaryen-dc9f3977561017924e08a8f87727f1ee1bcf8f97.tar.gz
binaryen-dc9f3977561017924e08a8f87727f1ee1bcf8f97.tar.bz2
binaryen-dc9f3977561017924e08a8f87727f1ee1bcf8f97.zip
Fix uninitialize variable warning
Diffstat (limited to 'src/emscripten-optimizer')
-rw-r--r--src/emscripten-optimizer/simple_ast.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/emscripten-optimizer/simple_ast.h b/src/emscripten-optimizer/simple_ast.h
index d74321aa7..cc07d8a12 100644
--- a/src/emscripten-optimizer/simple_ast.h
+++ b/src/emscripten-optimizer/simple_ast.h
@@ -27,6 +27,7 @@
#include <ostream>
#include <iostream>
#include <iomanip>
+#include <limits>
#include <functional>
#include <algorithm>
#include <set>
@@ -837,7 +838,8 @@ struct JSPrinter {
#define BUFFERSIZE 1000
static char full_storage_f[BUFFERSIZE], full_storage_e[BUFFERSIZE]; // f is normal, e is scientific for float, x for integer
static char *storage_f = full_storage_f + 1, *storage_e = full_storage_e + 1; // full has one more char, for a possible '-'
- double err_f, err_e;
+ auto err_f = std::numeric_limits<double>::quiet_NaN();
+ auto err_e = std::numeric_limits<double>::quiet_NaN();
for (int e = 0; e <= 1; e++) {
char *buffer = e ? storage_e : storage_f;
double temp;