dtr-org / unit-e

A digital currency for a new era of decentralized trust
https://unit-e.io
MIT License
45 stars 15 forks source link

Add -Wno-sign-compare compiler flag #847

Closed frolosofsky closed 5 years ago

frolosofsky commented 5 years ago

After upgrading Apples' developer tools, clang starts producing warnings in thousands of places, like:

std::vector<int> v;
...
BOOST_CHECK_EQUAL(v.size(), 0); // warning: comparison of integers of different signs: 'const int' and 'const unsigned int'

This code could be adjusted in the way:

std::vector<int> v;
...
BOOST_CHECK_EQUAL(v.size(), 0u);

But I'd postpone this change until we merge with bitcoin.

The flag -Wno-sign-compare reverts clang warning to the same level it was previously. I guess, they basically added -Wsign-compare in the -Wextra group.

$ /Library/Developer/CommandLineTools/usr/bin/clang++ --version
Apple LLVM version 10.0.1 (clang-1001.0.46.3)
Target: x86_64-apple-darwin18.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

To enable this flag you have to run ./autogen.sh