Fix warnings emitted by g++ 7.3.1 (#614)
authorAlpar Juttner <alpar@cs.elte.hu>
Mon, 15 Oct 2018 23:39:22 +0200
changeset 1179d7e25df22e88
parent 1178 61fdd06833a6
child 1180 389416f8a995
Fix warnings emitted by g++ 7.3.1 (#614)
lemon/arg_parser.cc
tools/dimacs-to-lgf.cc
     1.1 --- a/lemon/arg_parser.cc	Mon Oct 15 23:22:18 2018 +0200
     1.2 +++ b/lemon/arg_parser.cc	Mon Oct 15 23:39:22 2018 +0200
     1.3 @@ -221,9 +221,9 @@
     1.4                                  const std::string &opt)
     1.5    {
     1.6      Opts::iterator o = _opts.find(opt);
     1.7 -    Opts::iterator s = _opts.find(syn);
     1.8      LEMON_ASSERT(o!=_opts.end(), "Unknown option: '"+opt+"'");
     1.9 -    LEMON_ASSERT(s==_opts.end(), "Option already used: '"+syn+"'");
    1.10 +    LEMON_ASSERT(_opts.find(syn)==_opts.end(),
    1.11 +                 "Option already used: '"+syn+"'");
    1.12      ParData p;
    1.13      p.help=opt;
    1.14      p.mandatory=false;
     2.1 --- a/tools/dimacs-to-lgf.cc	Mon Oct 15 23:22:18 2018 +0200
     2.2 +++ b/tools/dimacs-to-lgf.cc	Mon Oct 15 23:39:22 2018 +0200
     2.3 @@ -73,11 +73,13 @@
     2.4        if (!output) {
     2.5          throw IoError("Cannot open the file for writing", ap.files()[1]);
     2.6        }
     2.7 +      // fall through
     2.8      case 1:
     2.9        input.open(ap.files()[0].c_str());
    2.10        if (!input) {
    2.11          throw IoError("File cannot be found", ap.files()[0]);
    2.12        }
    2.13 +      // fall through
    2.14      case 0:
    2.15        break;
    2.16      default: