arangodb / velocypack

A fast and compact format for serialization and storage
Other
420 stars 40 forks source link

Fix UB #134

Closed MBkkt closed 1 year ago

MBkkt commented 2 years ago

https://en.cppreference.com/w/cpp/numeric/bit_cast Hmm, shouldn't work for old compiler, memcpy?

maierlars commented 1 year ago

std::bit_cast is c++20. velocypack currently is at c++17. We first have to agree on moving to c++20 or you have to make the code conditional.

MBkkt commented 1 year ago

@maierlars we can just use memcpy

maierlars commented 1 year ago

your code uses std::bit_cast.

MBkkt commented 1 year ago

@maierlars I didn't know, thanks for mentioning

coveralls commented 1 year ago

Coverage Status

Coverage increased (+0.004%) to 96.242% when pulling 1e61a3786ff8d1954ed1550e3eaea27f9b07dd15 on mbkkt/fix_ub into 9906eb54a6f6d16778a153d7d4b6a482bde9916c on main.