C shennanigans.

This text focuses on some of the non-obvious and easy to make mistakes non-experienced C programmers are likely to make and are/can not completely be covered by tooling without going into edge cases relevant to performance:
  1. Pointer semantics
  2. Sequence points
  3. Bit-fields
Compiler flags or implementation may provide workarounds to these problems to prevent optimizations based on introduced Unedefined Behavior (UB). Review used C compilers with flags used including tests and and platforms before reusing of any code. The SEI wiki covers these cases without covering compiler workarounds leading to footguns, if code is used by other compiler implementations or with different compiler flags and is more verbose on rules how pointers are allowed to be used.