This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question about "#pragma pack(n)" and "-fpack-struct"
James E Wilson dixit:
>Currently, -fpack-struct is defined
>to have the same effect as attribute ((packed)) for all structures,
>which in turn is equivalent to #pragma pack(1) for all structures.
Let me please add a feature request here.
gcc warns if it cannot pack structs since they're already
in a more or less optimal form.
When you're using headers for structures e.g. used for PXE,
you've got to pack them since the data comes from the BIOS.
Using __attribute__((packed)) on these structures will then
give you a warning on i386 (and maybe none on amd64, but I
have not checked that).
When you're building with -Werror, that plainly sucks.
Luckily, my gcc 3.4.4 seems to not warn if I use #pragma pack;
that's all I request to be retained.
bye,
//mirabile
--
> [...] Echtzeit hat weniger mit "Speed"[...] zu tun, sondern damit, daß der
> richtige Prozeß voraussagbar rechtzeitig sein Zeitscheibchen bekommt.
Wir haben uns[...] geeinigt, dass das verwendete Echtzeit-Betriebssystem[...]
weil selbst einfachste Operationen *echt* *Zeit* brauchen. (aus d.a.s.r)