Newsgroups: comp.os.msdos.djgpp From: design AT netcom DOT com ('Aaron Waters') Subject: Re: sizeof(long double)==12 Message-ID: Organization: Design and Delivery References: <51om9k$cof AT bagan DOT srce DOT hr> Date: Wed, 18 Sep 1996 22:38:58 GMT Lines: 23 Sender: design AT netcom5 DOT netcom DOT com To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp In article <51om9k$cof AT bagan DOT srce DOT hr>, S. Mikecin wrote: >DJGPP has three floating-point (FP) data types: float (4 bytes), double (8 >bytes) and long double (12 bytes). Since x86 FPU supports ONLY >32-bit,64-bit and 80-bit floating-point numbers (and also 64-bit integer >numbers), I see no reason why long double is of size 12, and not 10 bytes! >It has nothing to do with alignment because it is also 12, even when I use >#pragma pack(1). Is there any explanation? This is properly a gcc question, which belongs in the gnu newsgroups, not a djgpp specific question. One way to tell the difference is to ask yourself: is this issue I am asking about likely to be an issue under Unix or OS/2 as well as under DOS? If the answer is yes, you need to talk to the gnu folks; if no, you have a true djgpp question. That said, the answer is: it has to do with alignment. First of all, last I checked, #pragma pack had no effect under gcc (RMS is strongly opposed to any use of #pragma). Second of all, even if you *did* use the gnu equivalent (whatever that is these days--all I remember for sure is that there is one), that only effects structures! And a long double is *NOT* a structure! Not even in 16 bit WinDOS compilers! ;) cheers, Chris