comp.lang.ada
 help / color / mirror / Atom feed
* Finding a record representation used by gnat
@ 1998-11-04  0:00 Mark
  1998-11-05  0:00 ` Mats Weber
  1998-11-05  0:00 ` Stephen Leake
  0 siblings, 2 replies; 3+ messages in thread
From: Mark @ 1998-11-04  0:00 UTC (permalink / raw)



Is it possible to find the representation used for a record compiled using 
GNAT 3.11a2 (DEC ALPHA).
I was hoping that either a gcc switch or a gnat utility to tell me this.


For those who want to know why ...

I am also compiling the same source using GNAT 3.10p under NT, and then
sending messages between the two different machine. As expected they
allocate fields differently.

The PC version is for testing, and my intention is to put a representaion
clause only on this. 

Later multiple identical machines with the same compiler will send the same
messages to each other (without the overhead of defining the representation
and allowing the representation to optimised by the compiler).
 




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Finding a record representation used by gnat
  1998-11-04  0:00 Finding a record representation used by gnat Mark
@ 1998-11-05  0:00 ` Mats Weber
  1998-11-05  0:00 ` Stephen Leake
  1 sibling, 0 replies; 3+ messages in thread
From: Mats Weber @ 1998-11-05  0:00 UTC (permalink / raw)


Mark wrote:
> 
> Is it possible to find the representation used for a record compiled using
> GNAT 3.11a2 (DEC ALPHA).
> I was hoping that either a gcc switch or a gnat utility to tell me this.
> 
> For those who want to know why ...
> 
> I am also compiling the same source using GNAT 3.10p under NT, and then
> sending messages between the two different machine. As expected they
> allocate fields differently.

Don't do that. Different versions of the same compiler on the same
platform may come up with different record layouts. And there are also
big endian/little endian and alignment issues.

You should either use GLADE (or parts thereof) or create your own
architecture-independent protocol for transmitting your data.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Finding a record representation used by gnat
  1998-11-04  0:00 Finding a record representation used by gnat Mark
  1998-11-05  0:00 ` Mats Weber
@ 1998-11-05  0:00 ` Stephen Leake
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Leake @ 1998-11-05  0:00 UTC (permalink / raw)


"Mark" <mark@lourow.demon.co.uk> writes:

> Is it possible to find the representation used for a record compiled using 
> GNAT 3.11a2 (DEC ALPHA).
> I was hoping that either a gcc switch or a gnat utility to tell me this.

See LRM 13.5.2, attributes 'position, 'first_bit, 'last_bit. Write a
short program that prints the results.

-- Stephe





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1998-11-05  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-11-04  0:00 Finding a record representation used by gnat Mark
1998-11-05  0:00 ` Mats Weber
1998-11-05  0:00 ` Stephen Leake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox