Comment by ryao

Comment by ryao 2 days ago

3 replies

This is not considering the document as a whole. I will defer to the GCC developers on what the document means on this.

jcranmer 2 days 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 2 days ago

    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.

trealira 2 days ago

I'm interested in hearing how considering the document as a whole leads to a different conclusion.