This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
sizeof(long double) ...
- To: gcc-bugs at gcc dot gnu dot org
- Subject: sizeof(long double) ...
- From: "M.W. van der Molen" <Matthijs dot M dot W dot vanderMolen at siep dot shell dot com>
- Date: Thu, 17 Aug 2000 16:34:45 +0200
- Organization: Shell E&P Technology Applications and Research
Compiled the following code on a number of platforms and got varying
output...
<BEGIN CODE>
#include <stdio.h>
#include <stream.h>
int main() {
cout << "sizeof(long double) : " << sizeof(long double) << endl;
}
<END CODE>
Using g++ version 2.95.2:
On Linux 2.2.15 (i686, no options): "sizeof(long double) : 12"
On IRIX 6.5.1m (R10000, option: -mabi=n32): "sizeof(long double) : 8"
On IRIX 6.5.1m (R10000, option: -mabi=n64): "sizeof(long double) : 8"
On Solaris 2.6 (UltraSPARC-II, no options): "sizeof(long double) : 16"
Using native compilers:
On IRIX 6.5.1m MIPSpro Compilers: Version 7.2.1
(CC -o32): "sizeof(long double) : 8"
(CC -n32): "sizeof(long double) : 16"
(CC -64): "sizeof(long double) : 16"
On Solaris 2.6 WorkShop Compilers 4.2 30 Oct 1996 C++ 4.2
"sizeof(long double) : 16"
I would have expected more consistent behaviour across the platforms
for gcc. If 16-byte variables give trouble on Intel I can understand
that,
but why not use 16-bytes on MIPS if the native compiler does so, and you
_do_ use them on SPARC ??
Kind regards,
Matthijs van der Molen
Shell E&P Technology Applications and Research
begin:vcard
n:van der Molen;Matthijs
tel;cell:+31 - 6 - 24 47 38 07
tel;fax:+31 - 70 - 311 2393
tel;home:+31 - 15 - 213 7711
tel;work:+31 - 70 - 311 6114
x-mozilla-html:TRUE
url:http://www.geocities.com/ResearchTriangle/Lab/7301
org:Shell E&P Technology Applications and Research;Shared Earth Modelling (EPT-AEF)
version:2.1
email;internet:m.w.vandermolen@siep.shell.com
title:Research Physicist
adr;quoted-printable:;;Volmerlaan 8=0D=0AP.O. Box 60;Rijswijk;ZH;2280 AB;the Netherlands
x-mozilla-cpt:;0
fn:Matthijs van der Molen
end:vcard