You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks again for both sparsepp and parallel-hashmap! I wanted to report a (fairly verbose) compiler warning I get when using sparsepp within some of our code. Specifically, I get a a compiler trace that ends in the following warning. It looks like the root cause is using realloc on a type that is not trivially copyable. Any suggestions on how to fix this?
sparsepp/spp_utils.h:425:51: warning: 'void* realloc(void*, size_t)' moving an object of non-trivially copyable type 'struct std::pair<const std::pair<unsigned int, unsigned int>, unsigned int>'; use 'new' and 'delete' instead [-Wclass-memaccess]
425 | pointer res = static_cast<pointer>(realloc(p, new_size * sizeof(T)));
The text was updated successfully, but these errors were encountered:
This type struct std::pair<const std::pair<unsigned int, unsigned int>, unsigned int> is in fact safe to reallocate, even if the c++11 API std::is_trivially_copyable returns false. sparsepp doesn't require a c++11 compiler and uses the internal spp::is_relocatable.
As far as I can tell this warning can safely be ignored.
Hi @greg7mdp,
Thanks again for both sparsepp and parallel-hashmap! I wanted to report a (fairly verbose) compiler warning I get when using sparsepp within some of our code. Specifically, I get a a compiler trace that ends in the following warning. It looks like the root cause is using realloc on a type that is not trivially copyable. Any suggestions on how to fix this?
The text was updated successfully, but these errors were encountered: