This is the mail archive of the 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: byte data size question

On Fri, Aug 31, 2001 at 02:31:42PM -0400, Barry Andreasen wrote:
> It seems that versions of GCC past 2.7.0 translate the type 'bool' to a
> single byte if the target is a CISC architecture, and to four bytes if the
> target is RISC (sparc).  I can't find any switches that control this
> behavior.  
> I am looking for workarounds that will allow me to communicate with
> CISC-based processed so that the data communication does not get corrupted
> by this misalignment.  The structure definition is common between the
> CISC-platform and RISC platform code.

The size of the individual elements of the structure will be only one
of your problems, also expect the alignment of the elements within the
structure different between machine types and even between compilers or
compiler revisions.

The workaround is quite easy (from "The practice of programming" by
Brian Kernighan and Rob Pike): use ASCII files to move data between
different kinds of machines.


J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
of Electrical Engineering, Faculty of Information Technology and Systems,
Delft University of Technology, PO BOX 5031,  2600 GA Delft, The Netherlands
Phone: +31-15-2783635  Fax: +31-15-2781843  Email:

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