skarupke / flat_hash_map

A very fast hashtable
1.69k stars 186 forks source link

Compiler warning: Null pointer arithmetic has undefined behavior #28

Open cebtenzzre opened 5 years ago

cebtenzzre commented 5 years ago
unordered_map.hpp:425:46: warning: performing pointer arithmetic on a null pointer has undefined behavior if the offset is nonzero [-Wnull-pointer-arithmetic]
        *new_buckets = EntryPointer(nullptr) + ptrdiff_t(1);

That line looks harmless to me, but undefined behavior should be avoided if at all possible.