News for hackers. Stuff that matters.
Re:Everything in C is undefined behavior by stilley2 on Wednesday May 20, 2026 @06:56AM (#48205771)
Does that mean that if I have a struct with #pragma pack(push, 1) I can't use pointers to any members that don't happen to be aligned?
Re:Everything in C is undefined behavior by saagarjha on Wednesday May 20, 2026 @07:22AM (#48205993)
This is a non-standard extension, so your compiler may provide stronger guarantees.
Re:Everything in C is undefined behavior by AlotOfReading on Wednesday May 20, 2026 @01:28PM (#48211108)
In practice, both GCC and Clang consider pointers to these unaligned members to be UB and will flag them in UBSAN.