From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Wed, 27 Nov 2013 16:35:34 -0500 To: 9fans@9fans.net Message-ID: In-Reply-To: References: <1ebc06ba0079a91546444a93ab21bc65@quintile.net> <12706eb9d1aafea3af76c427a31aae1a@coraid.com> <20131127203458.7E631B82A@mail.bitblocks.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] compiler bug? Topicbox-Message-UUID: 8c871c44-ead8-11e9-9d60-3106f5b1d025 > actually, even a union won't help you here: "When a value is stored in > a member of an object of union type, the bytes of the object > representation that do not correspond to that member but do correspond > to other members take unspecified values." in the example, don't all the bytes of i correspond to a byte to u, and thus can't take on unspecified values? or have i read that incorrectly? if i have, then FPdbleword is wrong, and all the code that uses it needs fixing. > Really, the way to do this particular operation portably is to write > it portably, and extract and rearrange the bytes. this certainly is the winning way to do this. clearer and there's no argument as to correctness. - erik