Closed seanmcl closed 6 years ago
The thousands of warnings were almost exclusively due to two pervasive issues: 1) Missing (but optional) override annotations. 2) Differences between how Linux and OSX deal with 'long' vs fixed-width types (in particular, "%ld" will safely print int64_t on Linux, but is incorrect on OSX).
The missing override annotations were a long standing irritation (but not a correctness problem), and your comments pushed me to finally take the time to deal with it. That should now be fixed.
Issue number 2 was indeed a correctness error for OSX. I've addressed this by standardizing on int64_t everywhere in the codebase (that was already mostly the case), and replacing "%ld" with the portable fixed width format specifiers from C++11's
There are likely still some subtle portability issues with OSX - but I hope to deal with them as they come up.
Compiling with g++-5, g++-7, and clang-5.0 on 64 bit Linux (Ubuntu 16.04), as well as with clang-700.0.72 on OSX 10.11.6, should come up completely warning free now (modulo some intentionally suppressed warnings about signedness and unused variables).
Wow, that has got to be a record turnaround time for fixing compiler warnings. Thanks!
Just curious on this one:
Building monosat on OSX with clang, I get thousands upon thousands of compiler warnings. Most are not so disturbing, but some are a little scary, e.g.
Are compiler warnings something that you'd like to eliminate eventually, or will they permanently be there?