I noticed that the sizeof a double is returned as 8,
which should be correct, but 4 is returned in align.

Sizeof seems to return incorrect values when taking
the size of a struct containing any variables of type
double when #pragma pack is used.

#pragma pack(8)
typedef struct _foo
{
char    a;
int     v1;
int     v2;
double  d1;
}foo;

sizeof(foo) = 20 regardless of the pack value set.
Using the above example it should return 24.

If I change the align to return 8 for type double then
sizeof seems to return the correct value taking into
consideration the pack value used.

So should align be returning 8 here?

Thanks,
Mike Henning

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


_______________________________________________
Tinycc-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to