This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: attribute ((packed)) on variables
- To: <meissner at cygnus dot com>
- Subject: Re: attribute ((packed)) on variables
- From: "Christian Häggström" <97nv46 at skola dot kiruna dot se>
- Date: Thu, 13 Apr 2000 12:08:35 +0200
- Cc: <gcc at gcc dot gnu dot org>
Thanks for your answer.
>... whether it defines MAX_OFILE_ALIGNMENT or not.
But I think you misunderstood me, I was asking for the minimum alignment, not the maximum. I wanted to make 'name' not aligned at all:
char name[33] __attribute__((aligned(1)));
This doesn t work. The manual says alignment can only be increased with this attribute.
char name[33] __attribute__((packed));
This should work (according to manual). But gcc says "warning: attribute 'packed' ignored"
Is there any way to misalign objects larger than 32 byte?
>> I use gcc 2.95.2 on a pentium.
>(you didn't mention the OS, which is crucial in this case, since each OS or
>object file format could define the macro or not).
>elf systems (ie,Linux) did not define MAX_OFILE_ALIGNMENT in 2.95, but do define it in the current snapshot.
Yes, you guess right, I use Linux. The object format doesn t matter as I convert it to binary format to use it for boot disks.