How to use packed attribute in mingw Compiler
-
I Have been facing an issue in which when i use #pragma pack and #pragma push packs my structure well in mingw compiler , where as when i use attribute(packed) it doesnt pack my structure , but in my case i want to use __attribute __ , is there any way possible to pack my structure
-
I Have been facing an issue in which when i use #pragma pack and #pragma push packs my structure well in mingw compiler , where as when i use attribute(packed) it doesnt pack my structure , but in my case i want to use __attribute __ , is there any way possible to pack my structure
@ManiRon28
From a couple of years ago at least there are posts stating that__attribute__ ((packed))
works in gcc but is "broken" in MinGW, and the suggested workaround is to use#pragma pack
:https://stackoverflow.com/a/37199319/489865
https://stackoverflow.com/a/31622291/489865
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52991