Re: Plan needed for switching m68k to 32-bit alignment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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"...





[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux