Closed ghost closed 8 years ago
Explicit casting should enable the exact same implicit behaviour as pre-gcc6 without having to adjust the algorithm or resort to -fpermissive or a less portable method.
This can be simplified to:
static const int kMinSignedValue = -(1 << kScaleBits);
Actually on closer look, the unsigned 1
is needed. In any case, more changes are needed to allow autofile to build on GCC 6. I think this PR should be closed in favour of #27 which seems to have everything.
Actually on closer look, the unsigned 1 is needed. In any case, more changes are needed to allow autofile to build on GCC 6.
I've used this to successfully compile with GCC-6.1.0 using both armv7a-hardfloat-linux-gnueabi and x86_64-pc-linux-gnu toolchains so I'm a little confused as to what other changes are necessary.
Did you run make check
?
The other changes fix the testsuite which isn't built by default.
Did you run make check? The other changes fix the testsuite which isn't built by default.
OK. Now I see. You're right.
Thanks for your suggestion, but I've taken another approach to solve this problem.
GCC-6 now treats the left bitwise-shift of a negative integer as nonconformant so explicitly cast to an unsigned int while bit-shifting.