www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/04/17:39:50

Sender: nate AT cartsys DOT com
Message-ID: <35C73608.BE5D0EC6@cartsys.com>
Date: Tue, 04 Aug 1998 09:25:44 -0700
From: Nate Eldredge <nate AT cartsys DOT com>
MIME-Version: 1.0
To: Guan Foo Wah <jgfw AT usa DOT net>
CC: djgpp AT delorie DOT com
Subject: Re: sizeof(long double) = 12 ???
References: <199808020838 DOT EAA10324 AT delorie DOT com>

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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019