g++ 7.2 Compiler Incompatibility

Issue #3 new
Zayd Hammoudeh created an issue

I tried building approxmc on a Ubuntu 17.10 VM. It is running g++ version 7.2.0. When trying to build, I get the following compilation error:

../../cmsat/Main.cpp:1080:42: error: call of overloaded ‘abs(uint32_t)’ is ambiguous if (abs(hashCount - mPrev) < 2 && mPrev!=0){

I do not get this error when building on a different machine with g++ 4.8.5. I also do not get this error when building cryptominisat.

I am not sure of the intended behavior here. Since both hashCount and mPrev are unsigned, if mPrev > hashCount, you will get roll over. Is that possible/expected?

Comments (2)

  1. Zayd Hammoudeh reporter

    Would it be correct to just remove the "abs"? In the end, I believe that is what is happening anyway.

  2. Log in to comment