Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Objective C Date: Sat, 21 Nov 2015 03:31:18 -0800 Organization: None to speak of Lines: 21 Message-ID: References: <1837148f-594b-4ffa-a0f3-bdce65277f5f@googlegroups.com> <0g2o4bpcd5ofn5a1rab2vftn0sivi8ssk9@4ax.com> <8nj05bha7qo58upepjqipdds0fgjkl8umb@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="8916"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX182LfeTHzCoBxbObOP8Xpsb" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:AYtZxFxf343ItR+FqozCJrcisfY= sha1:GnGWkj0wXBh8o/VQb3B5RYpLIng= Xref: csiph.com comp.lang.c:76754 Robert Wessel writes: [...] > And, of course, writing to one union member and reading from the other > is undefined. Incorrect. N1570 6.5.2.3p3, footnote: If the member used to read the contents of a union object is not the same as the member last used to store a value in the object, the appropriate part of the object representation of the value is reinterpreted as an object representation in the new type as described in 6.2.6 (a process sometimes called "type punning"). This might be a trap representation. -- 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"