From mboxrd@z Thu Jan 1 00:00:00 1970 From: "H. Peter Anvin" Date: Tue, 06 Nov 2007 08:30:54 +0000 Subject: Re: [klibc] klibc sparc trouble with gcc > 4.0 Message-Id: <4730263E.2090004@zytor.com> List-Id: References: <20071105135545.GA11201@stro.at> In-Reply-To: <20071105135545.GA11201@stro.at> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: sparclinux@vger.kernel.org Oleg Verych wrote: >> + uint32_t vx; >> + int dp; >> + >> + if (vhi) { >> + vx = vhi; >> + dp = 0; >> + } else { >> + vx = (uint32_t) v; > > `v' is a data in memory, accessed with 32-bits cast, thus operation > yields high 32-bits part of `v'. > Bullsh*t. That would be *(uint32_t *)&v. Casting between integer types truncate the high bits regardless of platform endianness. -hpa