3 ms·
I love this example. Even though you are aware how error-prone this is, you still get it wrong. long is 32-bits on GCC 32-bit. So it will still give the wrong
by nightcracker 10y ago
I love this example. Even though you are aware how error-prone this is, you still get it wrong.
long is 32-bits on GCC 32-bit. So it will still give the wrong result with `uint64_t`. You should be using __builtin_popcountll.
(don't get me wrong - you're not stupid, it happened to me too: https://github.com/orlp/libop/issues/1 https://github.com/orlp/libop/issues/1)
- psuter 10y agoGood catch, thanks. (It has been a while since I've been on a 32bit platform.)