This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: attribute ((packed)) on variables


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]