A few days ago in the Stringzilla string library for C++ I discovered that it defaults to unaligned store in its implementation of copy/memcpy. I know it's undefined behaviour according to C++. Now I'm trying to use Tracy profiling library, and in the documentation it says:
Tracy server requires CPU which can handle misaligned memory accesses.
Again, this is another library I've used within a couple of days that also does unaligned memory access in C++, which to my understanding is UB. I thought undefined behaviour was to be strongly condemned and avoided. Is this not the case? Are we supposed to just assume it'll work if the CPU supports it, albeit the language it's written in says it's undefined behaviour? Or are there special flags or extensions that can be set for the (I don't know) language standard or compiler that makes it OK?