GCC 4.7.0 breaks __attribute__((packed)) behavior on... (Developers)
Hi,
maybe some of you are using mingw32 and/or writing portable code for 32/64bit systems so it may save your time on hunting bugs. I just recompiled my KMD under new mingw32 4.7.0 and got a crash. After night tracking I found that the problem is in size of structure:
typedef struct { // 48-bit adresa GDT/IDT
Word limit; // size limit of GDT [Bytes-1]
DWord base; // linear base address of the GDT in physical memory
} __attribute__((packed)) GDTR;
You may think that __attribute__((packed)) save your ass and will be always 6 Bytes. Forget, not now, world is going mad and packing behaves differently.
To fix it, it's needed to add -mno-ms-bitfields gcc option since version 4.7.0.
But not at all systems. DJGPP 4.7.1 doesn't need it. But mingw32 and 64-bit linux gcc yes. More at https://lists.gnu.org/archive/html/qemu-devel/2012-07/msg02240.html
---
DOS gives me freedom to unlimited HW access.
Complete thread:
- GCC 4.7.0 breaks __attribute__((packed)) behavior on... - RayeR, 04.09.2012, 18:53 (Developers)
- GCC 4.7.0 breaks __attribute__((packed)) behavior on... - Rugxulo, 04.09.2012, 23:16
- GCC 4.7.0 breaks __attribute__((packed)) behavior on... - RayeR, 05.09.2012, 03:46
- GCC 4.7.0 breaks __attribute__((packed)) behavior on... - Rugxulo, 05.09.2012, 11:26
- GCC 4.7.0 breaks __attribute__((packed)) behavior on... - RayeR, 05.09.2012, 19:09
- GCC 4.7.0 breaks __attribute__((packed)) behavior on... - Rugxulo, 05.09.2012, 11:26
- GCC 4.7.0 breaks __attribute__((packed)) behavior on... - RayeR, 05.09.2012, 03:46
- GCC 4.7.0 breaks __attribute__((packed)) behavior on... - Rugxulo, 04.09.2012, 23:16