Post #399413 44 Sep 22, 2026, 12:00 UTC Type Punning in C and C++https://blog.pwkf.org/2026/09/21/correct-type-punning-in-c.html Personal Workflow Blog Type Punning in C and C++ I had a bug that took me a while to track down. The problem was type punning. A pointer cast worked fine at -O0 and silently broke at -O2. The C vs C++ distinction here is genuinely treacherous, and most blog posts on the topic get it wrong.