GCC 9.1.1 strict-overflow warnings
invexed opened this issue · 6 comments
invexed commented
GCC warns when enabling -Wstrict-overflow=n
for n > 1
. Some of the warnings can be suppressed with #pragma
s, but others can't as they are triggered at the call site during constexpr
expansion.
[build] .../frozen-master/include/frozen/bits/pmh.h:174:8: error: assuming pointer wraparound does not occur when comparing P +- C1 with P +- C2 [-Werror=strict-overflow]
[build] 174 | auto buckets = step_one.get_sorted_buckets();
[build] | ^~~~~~~
[build] .../frozen-master/include/frozen/bits/pmh.h:228:1: error: assuming pointer wraparound does not occur when comparing P +- C1 with P +- C2 [-Werror=strict-overflow]
[build] 228 | }
[build] | ^
serge-sans-paille commented
Thanks for reporting! Can you share the full error log?
invexed commented
Sure, please see attached file. Thanks for the quick response.
invexed commented
The call site is:
constexpr auto x = frozen::unordered_map<int, int, 1>{ {0, 0} };
serge-sans-paille commented
Thanks! I can reproduce :-)
serge-sans-paille commented
@invexed can you confirm the patch is good on your side?
invexed commented
Sorry, I didn't get notified about the PR. Yeah I can confirm that this patch fixes things on my end. Thanks again.