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: 1byte alignment for a whole lib/exe - how?


> Is this with gcc possible too? I found only commands (pack ...) to
> pack one single structure.

Please have a look at the documentation of -fpack-struct.

> Assuming I have built the com-lib with one byte alignment, is it
> possible to use it together with other code (main ...) that was
> compiled with default alignment (e.g. 8bytes)?

If the library and the rest of the application don't share *any*
structures, it might work. This means that you can't do the following
things in the library:
- use stdio (e.g. printf)
- use system calls that take structures (ioctl(2), stat(2))
- use setjmp

This list is not exhaustive. In short, you shouldn't include any
header files in your library, unless you know exactly what you are
doing.

Regards,
Martin


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