Re: Structure tag alignment problem

megatest! (Dave Jones)
16 Dec 91 23:51:27 GMT

          From comp.compilers

Related articles
Structure tag alignment problem (1991-12-15)
Re: Structure tag alignment problem (1991-12-15)
Re: Structure tag alignment problem megatest! (1991-12-16)
| List of all articles for this month |

Newsgroups: comp.compilers
From: megatest! (Dave Jones)
Keywords: C, GCC, portable
Organization: Megatest Corporation, San Jose, Ca
References: 91-12-064
Date: 16 Dec 91 23:51:27 GMT

>From article 91-12-064, by (Joe Gabriel):
> [i960 compiler aligns everything on 32 bit boundary, gcc 386 doesn't]

Solving this structure-tags problem will still leave you in a mess
if you ever need to communicate with a machine which has even more
storeage convention differences, such as byte-order.

Probably you should use some kind of serializing/deserializing protocol
which is more or less machine-independant. Sun's XDR is one such protocol.
Although it has some design-defects, it has the advantage of being free. It
is skewed toward Sun's internal representations of data. I don't know
if it has been ported to the processors you name. The standard FTP sites
all have it.

Another possibility is to send and receive the structures as text (ascii)
byte-sequences. This would require writing send/receive routines for
each data-structure (as does XDR -- the XDR package comes with programs
and library-routines to automate the process of writing said routines).

Project-suggestion: Wouldn't it be a good idea to design and standardize
an external data protocol based on text?

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.