Closed DevelopDaily closed 4 years ago
Can you please specify which compiler (version) you're using? And you mean casting the return? Or v
?
clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final) Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin
This is what I do:
return s_spp_popcount_default( (uint32_t) (v & -(intptr_t)v) - 1) );
return s_spp_popcount_default( (uint32_t) v);
Please note the compiler can work around the implicit casting by setting some compiler switches. But, I think it is perhaps better to do it explicitly just to avoid any subtle ambiguity.
@DevelopDaily Fixed in the latest release
https://github.com/softwareQinc/staq/blob/bc9caf8acca0cc6e7394547e4125ff7ecf06eb26/libs/sparsepp/spp_utils.h#L373
https://github.com/softwareQinc/staq/blob/bc9caf8acca0cc6e7394547e4125ff7ecf06eb26/libs/sparsepp/spp_utils.h#L378
I have to cast the type (uint32_t) to the argument explicitly just to make my compiler happy. I did that without intellectual rigor:-)
Could you please take a look at the issue?
Thanks.