[Bug c++/36566] Cannot bind packed field
rene.rahn@fu-berlin.de
gcc-bugzilla@gcc.gnu.org
Tue Mar 3 16:54:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36566
rene.rahn@fu-berlin.de changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rene.rahn@fu-berlin.de
--- Comment #10 from rene.rahn@fu-berlin.de ---
I know this is quite old now. But can someone explain me why using `#pragma
pack(push, 1)` does work then? I couldn't find enough resources on that. The
only thing I found is, that it does literally the same. But wouldn't then the
references/pointers still not be valid?
So if I change the code to:
```
#pragma pack(push, 1)
struct Squeeze
{
short s;
};
#pragma pack(pop)
```
Then it works on godbolt with gcc-trunk.
More information about the Gcc-bugs
mailing list