Closed susnux closed 8 years ago
This is strange—stack[sp]
should be promoted from char
to int
to be the argument of int abs(int)
.
I'm guessing that GCC6 provides a char abs(char)
function.
I will include this fix in the future.
hmm maybe gcc brings the float overload into global namespace. It might work to use std::abs explicitly instead of casting.
If GCC6 provides char std::abs(char)
, then casting is the only way to fix it.
Ok the cast is the best solution, I think it happens because of the new overload:
double abs( Integral arg );
so casting to int will use int abs(int)
which is the desired one.
Here's how AC addressed this: in assaultcube/AC@752950989b4e286459ca9aee3d61a868d7b20fa4, they created an inline function that implicitly casts to int and calls labs.
As you haven't mentioned other errors with GCC6, I'll fix this specific issue with a cast.
I get this error:
I fixed it for myself by changing to: