[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Size of (long double) ??



Hi!

I run this program in Debian/Alpha:

<------------------------------------------->

#include <stdio.h>

main()
{
        printf("sizeof(char) = %i\n", (int) sizeof(char));
        printf("sizeof(short) = %i\n", (int) sizeof(short));
        printf("sizeof(long) = %i\n", (int) sizeof(long));

        printf("sizeof(float) = %i\n", (int) sizeof(float));
        printf("sizeof(double) = %i\n", (int) sizeof(double));

        printf("sizeof(long double) = %i\n", (int) sizeof(long double));

}

<-------------------------------------------->

An it shows me this output:

$ showsizes
sizeof(char) = 1
sizeof(short) = 2
sizeof(long) = 8
sizeof(float) = 4
sizeof(double) = 8
sizeof(long double) = 8
$

The last line says sizeof(long double) is 8, the same as type (double).
This is
a bit  "short" for this type (even in the i386, this program reports
sizeof(long double)
is 12).

Under xxgdb on Debian-Alpha, the command

(xxgdb)  display sizeof(long double)

shows the size of this type is 16 (I think this is the right one).

Since Alpha system is new to me, any comment about this issue would be
appreciated.
¿How can size of "double" and "long double" be the same?
Is there a bug in gcc for Alpha? Mine is 2.95.2 under Debian/potato

Regards,

--
Jose Rodriguez          jrguez@inm.es
Instituto Nacional de Meteorologia          SPAIN




Reply to: