Forgot…

>tg@fish:~ $ ./a.out

struct baa {
        int a;
        long long b;
};

#include <stddef.h>
#include <stdio.h>

int main(void) {
        struct baa stct;

#define t(w,s) printf("%s\ts=%u\ta=%u\n", #w, \
            (unsigned)sizeof(s), (unsigned)__alignof__(s))
#define o(w,m) printf("%s\ts=%u\ta=%u\to=%u\n", #w, \
            (unsigned)sizeof(stct.m), (unsigned)__alignof__(stct.m), \
            (unsigned)offsetof(struct baa, m))
        t(int, int);
        t(llong, long long);
        t(baa, struct baa);
        o(baa.a, a);
        o(baa.b, b);
        return (0);
}

bye,
//mirabilos
-- 
[16:04:33] bkix: "veni vidi violini"
[16:04:45] bkix: "ich kam, sah und vergeigte"...

Reply via email to