This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
sizeof and alignement
- To: help-gcc at gnu dot org
- Subject: sizeof and alignement
- From: David Martinez Garcia <david at fssintl dot com>
- Date: Thu, 30 Mar 2000 08:25:02 +0200
- Organization: FSS International Europe
Dear friends,
We have compiled (using gcc on Linux-Intel platform) with succes some
applications developed in Solaris. Now we want to read the information of
binary files produced in the Sun platform but we have a problem. In
several cases the command 'sizeof' gives different values in both
platforms. Generally only few bytes (4, 8, 12...). We think this is due to
the memory alignment that is forced in the Sun platform. This differences
avoid us to read the right number of bytes when some complex structures
have been writen using the sizeof command in the fwrite instructions. Is
there any way for solving this problem ? Can we force the gcc compiler to
modify the alignment of the produced code ? Where can we find information
about this common problems when porting applications ?
If you are able of answer any of the previous questions it would be great.
--
David Martinez Garcia
david@fssintl.com
FSS International Europe
Tel. +34 963 826 394
Fax +34 963 826 392