comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.not.jrcarter@acm.not.spam.org>
Subject: Re: aliased and parameters
Date: Mon, 31 Jul 2006 18:37:00 GMT
Date: 2006-07-31T18:37:00+00:00	[thread overview]
Message-ID: <g5szg.66349$FQ1.55209@attbi_s71> (raw)
In-Reply-To: <1154369116.867649.278950@m73g2000cwd.googlegroups.com>

REH wrote:
> ...
> recv(socket, Hdr'Address, header_size);
> 
> The problem is that some Ada95 compiler are so aggressive with
> optimization that they may not "see" then Hdr is changed by recv.  At
> the very less the compiler complains (rightfully so) that Hdr is alised
> but not marked as such.  But how do enforce that if I cannot define the
> parameter as aliased?  Should I use an access type instead and convert
> it to System.Address, or is there a cleaner way?

You should not be using 'Address at all. I don't know the definition of 
Recv, so I can't say what would be better. If it's an interface to C, 
you might want an array or a C-compatible access value.

Of course, that assumes you can change the library in question.

-- 
Jeff Carter
"Death awaits you all, with nasty, big, pointy teeth!"
Monty Python & the Holy Grail
20



  reply	other threads:[~2006-07-31 18:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-31 18:05 aliased and parameters REH
2006-07-31 18:37 ` Jeffrey R. Carter [this message]
2006-07-31 19:02   ` REH
     [not found]     ` <1154373046.777655.292010@m79g2000cwm.googlegroups.com>
2006-07-31 19:26       ` REH
2006-07-31 19:59         ` REH
2006-07-31 21:52     ` Björn Persson
2006-08-01  0:35       ` REH
2006-08-01  1:31     ` Jeffrey R. Carter
2006-08-01  2:28       ` REH
replies disabled

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