← 返回事件
持续讨论科技

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.

摘要按规则整理自下方来源原文

为什么在扩散

来源

社区讨论