Commit d2d03d76 authored by Matthias Braun's avatar Matthias Braun
Browse files

use attribute((packed)) for now, so that gcc and eccp produce the same results...

use attribute((packed)) for now, so that gcc and eccp produce the same results for bitfields and our tests succeed
parent 9c08d21b
//#include "dumpmem.h"
#include "dumpmem.h"
struct bf {
int a;
......@@ -8,13 +8,13 @@ struct bf {
char c;
double d;
unsigned w:9;
};
} __attribute__((packed));
struct bf mybf = { 0xffffffff, 4097, 65537, 5, 0xff, 4.5, 257 };
int main(void) {
//dumpMem(&mybf, sizeof mybf);
dumpMem(&mybf, sizeof mybf);
printf("sizeof mybf %d\n", sizeof mybf);
return 0;
......
......@@ -8,7 +8,7 @@ struct bf {
char c;
double d;
unsigned w:9;
};
} __attribute__((packed));
#define offsetof(TYPE, MEMB) ((size_t) &((TYPE *)0)->MEMB)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment