Question about -ansi flag, and different size of struct from C and C++

Oleg Ivanov Belinus at zelax.ru
Mon Dec 15 12:02:29 UTC 2003


    Hello list,
    I have a problem. I defined struct like:
        struct dummy {
          int var1;
          short var2;
          int var3;
       } __attribute__ ((packed));

    and access to it from C and C++ code.
    The problem is that size from C is 10 bytes and from C++ is 12 
bytes, I couldn't make that C++ packed that struct, exept removing -ansi 
flag from compiler string.
    So I have two question, is there another method to ask C++ packed 
struct, and do we really need -ansi flag to compile rtems ?
    Thanks






More information about the users mailing list