Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: lvalues from the ternary op Date: Fri, 24 Feb 2017 13:49:41 -0800 Organization: None to speak of Lines: 24 Message-ID: References: <2f20253f-9ce6-4dcd-82e7-2fcdc2eae5b0@googlegroups.com> <698d5687-fb5e-488d-841e-99991d26c314@googlegroups.com> <87y3xqn0fe.fsf@bsb.me.uk> <151d7ce8-f628-4f42-a2a3-c92a8bb7e682@googlegroups.com> <87a8a5mgte.fsf@bsb.me.uk> <276589b7-b156-44a0-baeb-551aa95691a2@googlegroups.com> <00c2c595-687f-4f18-a7a6-a076e8253e71@googlegroups.com> <7cf3d284-16e8-4f6a-8f3a-b62b8fbcd9c5@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="6b4ae51bb3e4b1095130ab23a20a425a"; logging-data="10696"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/nHyvB88Ds+2Cjo9FhBkBD" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:GpROsJ1WHnJjSdmpfZ3iGNcyscY= sha1:wPp2WZmZ+ky8cVSIkEbg3tYIaNU= Xref: csiph.com comp.lang.c:104649 Keith Thompson writes: > supercat@casperkitty.com writes: [...] >> True or false: if any of the ways in which a conforming implementation >> could process an action invoke UB, the action itself invokes UB. > > I think there's a statement in the standard that's similar to that, > though I'm not at all certain about it. If there is, I suggest citing > it directly so we can judge whether your summary is accurate. The statement I was thinking of is in N1570 6.5p2: If there are multiple allowable orderings of the subexpressions of an expression, the behavior is undefined if such an unsequenced side effect occurs in any of the orderings. I don't believe it applies to the union member access you're talking about. Perhaps you were thinking of some other wording in the standard. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"