Friday, September 30, 2016

Packed struct for LLVM

typedef struct __attribute__ ((packed))          
{
    int a ;
    char b ;
} TEST_T ;
Size: 5 Bytes


Putting it in the end as below won't work!! Also, aligned(1) does not work either!

typedef struct
{
    int a ;
    char b ;
} TEST_T __attribute__ ((packed)) ;   X
Size: 8 Bytes

typedef struct
{
    int a ;
    char b ;
} TEST_T __attribute__ ((aligned(1))) ;   X
Size: 8 Bytes

typedef struct __attribute__ ((aligned(1))) ;   X
{
    int a ;
    char b ;
TEST_T ;
Size: 8 Bytes

No comments:

Check clients which connect to Mac OS X Wi-Fi Internet Sharing

arp -i bridge100 -a bridge100 may be different on your Mac OSX