This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: 1byte alignment for a whole lib/exe - how?
- To: pmueller at decrc dot abb dot de
- Subject: Re: 1byte alignment for a whole lib/exe - how?
- From: "Martin v. Loewis" <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Thu, 11 Mar 1999 23:18:59 +0100
- CC: egcs at egcs dot cygnus dot com
- References: <36E7AB6C.3B6310B0@decrc.abb.de>
> 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