-Wpessimizing-move warns when a call to std::move would prevent copy elision
if the argument was not wrapped in a call. This happens when moving a local
variable in a return statement when the variable is the same type as the
return type or using a move to create a new object from a temporary object.
-Wredundant-move warns when an implicit move would already be made, so the
std::move call is not needed, such as when moving a local variable in a return
that is different from the return type.
Boost libraries on osx use visibility=hidden to reduce unnecessary DWARF entries.
Unless we match visibility, ld will give a warning message like:
ld: warning: direct access in function 'boost::filesystem... from file ...
means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
CMake defaults to C *and* C++ toolchain, in case nothing has been specified.
This means that cmake always checks for both, which is more than needed.
This PR cuts off C toolchain requirement from /CMakeLists.txt and ensures that we
don't pass along any `..._C_...` variables in EthCompilerSettings.cake nor jsoncpp.cmake.
Removed push/pop if there was no change to the warnings *in the same
file* for a given compiler. This assumes the imported boost headers use
a warning stack themselves.
The pragmas don't seem to be required anymore, but were not removed to
mantain compatibility with older versions of the boost library.
Compiled with
- clang version 6.0.1 (tags/RELEASE_601/final)
- gcc (GCC) 8.1.1 20180531
against:
- libboost 1.67.0-5
This also removed PROFILE option that also adds --coverage flag. Instead you can use -DCMAKE_EXE_LINKER_FLAGS=-lprofiler. The profiling options can be added back when better investigated (e.g. -lprofiler vs -pg options).
In my system I have gcc 7.1.1 and there I get a lot of warnings which
fail the build due to implicit fallthroughs in switch statements.
Some examples can be seen here:
https://gist.github.com/LefterisJP/388c3ba5ad356f92a3b44e7efed89f9f
This PR proposes a simple solution, which is to ignore the warning for
both gcc and clang.