Sender: nate AT cartsys DOT com Message-ID: <35C73608.BE5D0EC6@cartsys.com> Date: Tue, 04 Aug 1998 09:25:44 -0700 From: Nate Eldredge MIME-Version: 1.0 To: Guan Foo Wah CC: djgpp AT delorie DOT com Subject: Re: sizeof(long double) = 12 ??? References: <199808020838 DOT EAA10324 AT delorie DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk Guan Foo Wah wrote: > > I tried sizeof (long double) and it returns 12. I tried the same thing on > MSC++ 7 and it returns 10. > > Why is this so ?? Is it because of the dword alignment ? Yes. On x86, the long double is actually an 80-bit value (10 bytes). But GCC pads with two additional bytes to keep each one on a dword boundary. This is helpful to most processors, and can yield a significant speed advantage. -- Nate Eldredge nate AT cartsys DOT com