News for hackers. Stuff that matters.
Re:NanoLog – a nanosecond scale logging system for C++ by gpderetta on Sunday September 01, 2019 @03:25PM (#20854203)
> casting to char and then to int-type to inspect multiple bytes is fine as long as alignment plays correctly

It is only fine if there were the same exact int types at that address. Remember, UB usually isn't the reinterpret_cast but the dereference.

Re:NanoLog – a nanosecond scale logging system for C++ by detaro on Sunday September 01, 2019 @03:27PM (#20854222)
I thought the int-types had a special exception making that always possible (if there's a bunch of bytes, you can turn them into an int), but I could very well be wrong on that detail.
Re:NanoLog – a nanosecond scale logging system for C++ by gpderetta on Sunday September 01, 2019 @03:50PM (#20854398)
Char is the only exception.

And now std::byte IIRC