From: Nadav Har'El <n...@scylladb.com>
Committer: Nadav Har'El <n...@scylladb.com>
Branch: master

gcc 7: array should have non-negative length

Gcc 7 rightly complains when we try to allocate an array with a signed
int length. Changing the length variable to unsigned int fixes it.

Signed-off-by: Nadav Har'El <n...@scylladb.com>
Message-Id: <20170712151334.12673-4-...@scylladb.com>

---
diff --git a/core/app.cc b/core/app.cc
--- a/core/app.cc
+++ b/core/app.cc
@@ -297,7 +297,7 @@ void application::run_main(std::string path, int argc, char** argv)
     program_invocation_name = c_path;
     program_invocation_short_name = basename(c_path);

-    auto sz = argc; // for the trailing 0's.
+    unsigned sz = argc; // for the trailing 0's.
     for (int i = 0; i < argc; ++i) {
         sz += strlen(argv[i]);
     }

--
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to