Merge pull request #2534 from digit-google/fix-build-log-leak

Fix build log leak
diff --git a/configure.py b/configure.py
index 21374d2..2b404bd 100755
--- a/configure.py
+++ b/configure.py
@@ -329,11 +329,12 @@
         raise Exception('cl.exe not found. Run again from the Developer Command Prompt for VS')
     cflags = ['/showIncludes',
               '/nologo',  # Don't print startup banner.
+              '/utf-8',
               '/Zi',  # Create pdb with debug info.
               '/W4',  # Highest warning level.
               '/WX',  # Warnings as errors.
               '/wd4530', '/wd4100', '/wd4706', '/wd4244',
-              '/wd4512', '/wd4800', '/wd4702', '/wd4819',
+              '/wd4512', '/wd4800', '/wd4702',
               # Disable warnings about constant conditional expressions.
               '/wd4127',
               # Disable warnings about passing "this" during initialization.
diff --git a/src/ninja.cc b/src/ninja.cc
index bf8c3f6..f681bfe 100644
--- a/src/ninja.cc
+++ b/src/ninja.cc
@@ -1422,6 +1422,10 @@
   } else if (name == "phonycycle=warn") {
     options->phony_cycle_should_err = false;
     return true;
+  } else if (name == "dupbuild=err" ||
+             name == "dupbuild=warn") {
+    Warning("deprecated warning 'dupbuild'");
+    return true;
   } else if (name == "depfilemulti=err" ||
              name == "depfilemulti=warn") {
     Warning("deprecated warning 'depfilemulti'");
diff --git a/src/parser.h b/src/parser.h
index 011fad8..75990aa 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -26,6 +26,7 @@
 struct Parser {
   Parser(State* state, FileReader* file_reader)
       : state_(state), file_reader_(file_reader) {}
+  virtual ~Parser() {}
 
   /// Load and parse a file.
   bool Load(const std::string& filename, std::string* err, Lexer* parent = NULL);
diff --git a/src/util.cc b/src/util.cc
index 70421bf..c90dc58 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -544,7 +544,7 @@
 
   if (msg_buf == nullptr) {
     char fallback_msg[128] = {0};
-    snprintf(fallback_msg, sizeof(fallback_msg), "GetLastError() = %d", err);
+    snprintf(fallback_msg, sizeof(fallback_msg), "GetLastError() = %lu", err);
     return fallback_msg;
   }