vietjtnguyen / argagg

A simple C++11 command line argument parser
MIT License
224 stars 28 forks source link

Fix build errors #9

Closed myint closed 7 years ago

myint commented 7 years ago

This fixes the following build errors that show up on my machine at home:

In file included from /Users/myint/tmp/argagg/test/test.cpp:1:
/Users/myint/tmp/argagg/test/../include/argagg/argagg.hpp:727:38: error:
      implicit instantiation of undefined template 'std::__1::array<const
      argagg::definition *, 256>'
  std::array<const definition*, 256> short_map;
                                     ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tuple:116:65: note:
      template is declared here
template <class _Tp, size_t _Size> struct _LIBCPP_TYPE_VIS_ONLY array;
                                                                ^
In file included from /Users/myint/tmp/argagg/test/test.cpp:1:
/Users/myint/tmp/argagg/test/../include/argagg/argagg.hpp:895:9: error: moving a
      temporary object prevents copy elision [-Werror,-Wpessimizing-move]
        std::move(std::make_pair(defn.name, opt_results)));
        ^
/Users/myint/tmp/argagg/test/../include/argagg/argagg.hpp:895:9: note: remove
      std::move call here
        std::move(std::make_pair(defn.name, opt_results)));
        ^~~~~~~~~~                                      ~
2 errors generated.
make[2]: *** [CMakeFiles/argagg_test.dir/test/test.cpp.o] Error 1
make[1]: *** [CMakeFiles/argagg_test.dir/all] Error 2
make: *** [all] Error 2
In file included from /Users/myint/tmp/argagg/test/test.cpp:1:
/Users/myint/tmp/argagg/test/../include/argagg/argagg.hpp:797:20: error: suggest braces around initialization of subobject
      [-Werror,-Wmissing-braces]
  parser_map map {{nullptr}, {}};
                   ^~~~~~~
                   {      }
myint commented 7 years ago

It looks like the Coveralls part of the Travis CI script might not be correct for pull requests.

The command "lcov -l coverage.info" exited with 0.
0.14s$ coveralls-lcov --repo-token ${COVERALLS_TOKEN} coverage.info
Too many arguments! <>
  Usage: coveralls-lcov [options] coverage.info
  e.g. coveralls-lcov -v coverage.info
    -t, --repo-token=TOKEN           Repository token
    -s, --service-name=SERVICENAME   Service name
        --retry=N                    Retry to POST N times (default: 3)
        --delay=N                    Delay in N secs when retry (default: 3)
        --source-encoding=ENCODING   Source files encoding  (default: UTF-8)
    -v, --verbose                    Print payload
    -n, --dry-run                    Dry run
The command "coveralls-lcov --repo-token ${COVERALLS_TOKEN} coverage.info" exited with 1.
Done. Your build exited with 1.
vietjtnguyen commented 7 years ago

Thanks. I hadn't tested with clang yet. I'm surprised GCC let me get away with not including <array>.