Remix.run Logo
jcranmer a day ago

I am a member of the C standards committee, and I'm telling you you're wrong here. Martin Uecker is also member of the C standards committee, and has just responded to that bug saying that the comment you linked is wrong. I, and others here, have quoted literal standards text to you explaining why type punning through unions is well-defined behavior in C.

I don't know who Andrew Pinski is, but they're factually incorrect regarding the legality of type punning via unions in C.

uecker a day ago | parent [-]

Andrew is a GCC developer who is very competent (much more than myself regarding GCC), but I think he was mistakenly assuming the C++ rules apply to C here as well.