[Bug c/87942] New: every int seems to be unaligned in packed structure

2018-11-08 Thread johannes.vet...@dom-sicherheitstechnik.de
Component: c Assignee: unassigned at gcc dot gnu.org Reporter: johannes.vet...@dom-sicherheitstechnik.de Target Milestone: --- testcode: #pragma pack(1) typedef struct { volatile int cmd; } test_t; #pragma pack(0) test_t test; int read32() { test.cmd = 11

[Bug c/87942] every int seems to be unaligned in packed structure

2018-11-09 Thread johannes.vet...@dom-sicherheitstechnik.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87942 --- Comment #3 from Johannes Vetter --- Ok, thanks a lot. I haven't expected that an initializer could change the alignment of a variable. "-fno-common" does not work in my case (perhaps because the variable already has a attribute "section").