3 ms·
I was responding to the author's general claim that "In the old days it was possible to access members of structs inside unions without having to name the inter
by binarycrusader 13y ago
I was responding to the author's general claim that "In the old days it was possible to access members of structs inside unions without having to name the intermediate struct.".
However, I stand corrected in two regards. The first is that as of gcc 4.6+, the sed example the author provided is no longer allowed even if the structs are unnamed. (I was testing with gcc 3.4.) I verified that gcc 3.4 would happily allow me to use the provided sed example as long as I removed the names from the structs.
Second, the C11 standard specifically does not allow for the sed example provided because the structs in the unions contain duplicate members.
I had seen reasoning that hinted at what you're saying in one of the comments posted on the author's blog entry.
Regardless, thanks for encouraging me to dig deeper.