What is the strict aliasing rule?
问题 When asking about common undefined behavior in C, people sometimes refer to the strict aliasing rule. What are they talking about? 回答1: A typical situation you encounter strict aliasing problems is when overlaying a struct (like a device/network msg) onto a buffer of the word size of your system (like a pointer to uint32_t s or uint16_t s). When you overlay a struct onto such a buffer, or a buffer onto such a struct through pointer casting you can easily violate strict aliasing rules. So in