[Lemon-commits] Alpar Juttner: Fix warnings emitted by g++ 7.3.1...

Lemon HG hg at lemon.cs.elte.hu
Wed Oct 17 20:07:37 CEST 2018


details:   http://lemon.cs.elte.hu/hg/lemon/rev/d7e25df22e88
changeset: 1397:d7e25df22e88
user:      Alpar Juttner <alpar [at] cs.elte.hu>
date:      Mon Oct 15 23:39:22 2018 +0200
description:
	Fix warnings emitted by g++ 7.3.1 (#614)

diffstat:

 lemon/arg_parser.cc    |  4 ++--
 tools/dimacs-to-lgf.cc |  2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diffs (32 lines):

diff --git a/lemon/arg_parser.cc b/lemon/arg_parser.cc
--- a/lemon/arg_parser.cc
+++ b/lemon/arg_parser.cc
@@ -221,9 +221,9 @@
                                 const std::string &opt)
   {
     Opts::iterator o = _opts.find(opt);
-    Opts::iterator s = _opts.find(syn);
     LEMON_ASSERT(o!=_opts.end(), "Unknown option: '"+opt+"'");
-    LEMON_ASSERT(s==_opts.end(), "Option already used: '"+syn+"'");
+    LEMON_ASSERT(_opts.find(syn)==_opts.end(),
+                 "Option already used: '"+syn+"'");
     ParData p;
     p.help=opt;
     p.mandatory=false;
diff --git a/tools/dimacs-to-lgf.cc b/tools/dimacs-to-lgf.cc
--- a/tools/dimacs-to-lgf.cc
+++ b/tools/dimacs-to-lgf.cc
@@ -73,11 +73,13 @@
       if (!output) {
         throw IoError("Cannot open the file for writing", ap.files()[1]);
       }
+      // fall through
     case 1:
       input.open(ap.files()[0].c_str());
       if (!input) {
         throw IoError("File cannot be found", ap.files()[0]);
       }
+      // fall through
     case 0:
       break;
     default:


More information about the Lemon-commits mailing list