Steve Bennett <[EMAIL PROTECTED]> wrote:

> Joerg,
>
> I can't quite see where you are going with all this.

Could you run another test?

#include <stdio.h>

struct test1
{
    char blerg[1];
    char type[4];
    char flibble[3];
    char more[2];
} __attribute__((packed));

_Pragma("pack(1)") struct test2
{
    char blerg[1];
    char type[4];
    char flibble[3];
    char more[2];
};

int main (int argc, char **argv)
{
    printf("sizeof(test1) is %d\n", sizeof(struct test1));
    printf("sizeof(test2) is %d\n", sizeof(struct test2));
    
    return 0;
}

What does this print?

What do you get from:

printf("vers %d\n", __STDC_VERSION__):

what do you get from:

struct test1
{
    char blerg[1];
    char type[4];
    char flibble[3];
    char more[2];
    char dummy[];
};

int main (int argc, char **argv)
{
    printf("sizeof(test1) is %d\n", sizeof(struct test1));
    
    return 0;
}

Jörg

-- 
 EMail:[EMAIL PROTECTED] (home) Jörg Schilling D-13353 Berlin
       [EMAIL PROTECTED]                (uni)  
       [EMAIL PROTECTED]     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily

Reply via email to