Any way of persuading GNAT/GCC to implement a true overlay and not a pointer?
- From: "Doobs" <doobs@xxxxxxxxx>
- Date: Sat, 1 Apr 2006 14:47:59 +0100
I was under the impression that code of the following form :
X : <Some Type>;
Y : <Some Type>;
for Y'Address use X'Address;
would result in an overlay in the resulting code. However on a project
where external test equipment showed that the contents of X were NOT the
same as Y I investigated further. I checked on both a Windows host version
of GCC (3.4.2) and a target cross compiler (GCC 3.4.4) and on both the
construct above is actually implemented using indirection (a pointer). The
map file and symbol table show that irrespective of the data type and size
of Y it is always implemented as a pointer to X. Although this appears
semantially identical to an overlay as far as the progam is concerned it is
NOT identical as far as an external observer is concerned. I have a bit
packed record which I wanted to return as an array of longwords to pretty
dumb test equipment. The easiest way *would* be to overlay a longword
array - however this would not appear to be possible.....
.
- Follow-Ups:
- Re: Any way of persuading GNAT/GCC to implement a true overlay and not a pointer?
- From: Randy Brukardt
- Re: Any way of persuading GNAT/GCC to implement a true overlay and not a pointer?
- From: Florian Weimer
- Re: Any way of persuading GNAT/GCC to implement a true overlay and not a pointer?
- From: Jeffrey Creem
- Re: Any way of persuading GNAT/GCC to implement a true overlay and not a pointer?
- Prev by Date: Re: Q: Open-source to access MS SQL server 2000/2005 DBs from Ada ?
- Next by Date: Re: Any way of persuading GNAT/GCC to implement a true overlay and not a pointer?
- Previous by thread: Re: Q: Open-source to access MS SQL server 2000/2005 DBs from Ada ?
- Next by thread: Re: Any way of persuading GNAT/GCC to implement a true overlay and not a pointer?
- Index(es):
Relevant Pages
|