1byte alignment for a whole lib/exe - how?
Martin v. Loewis
martin@mira.isdn.cs.tu-berlin.de
Wed Mar 31 23:46:00 GMT 1999
> 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
More information about the Gcc
mailing list