[Bug c/60809] C99 struct initialiser with embedded self assignment
jimis at gmx dot net
gcc-bugzilla@gcc.gnu.org
Thu Apr 10 14:10:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60809
--- Comment #2 from jimis <jimis at gmx dot net> ---
(In reply to Marek Polacek from comment #1)
> I see nothing surprising here; an assignment expression has the value of the
> left operand after the assignment. So we 1) set query2.ai_flags to
> AI_PASSIVE, 2) use this value to initialize .ai_protocol.
if the outer assignment runs last, shouldn't it overwrite the inner assignment?
Then it should be equivalent to that:
<pre>
struct addrinfo query3 = {
.ai_family = AF_UNSPEC,
.ai_socktype = SOCK_STREAM,
1
</pre>
Which means that ai_flags should be 0.
More information about the Gcc-bugs
mailing list