comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <leakstan@erols.com>
Subject: Re: ObjectAda: LPCSTR -> STRING ?
Date: 1998/01/07
Date: 1998-01-07T00:00:00+00:00	[thread overview]
Message-ID: <34B3A107.76DC@erols.com> (raw)
In-Reply-To: dewar.884108955@merv


Robert Dewar wrote:
> 
> Robin said

Actually, I'm Stephe; my mailer is confused.

> 
> <<         (LpSection => C_Section (C_Section'First)'address,
>           LpKeyName => System.Null_Address,
>           LpString => C_Section (C_Section'First)'Address,
>           LpFileName => C_File (C_File'First)'Address);
> >>
> 
> Note that for any compiler following the implementation advice in the RM
> (all currently available Ada 95 compilers do so), the use of the
> X'First subscript here is obfuscation. In fact there is no real reason
> to suppose that it will work any better than simply saying
> C_File'Address, since neither is really guaranteed to work in an absolute
> semantic sense, and in practice they are interchangable.
> 
> I think it is reasonable to avoid FUD about compilers not doing the
> sensible thing if that FUD results in obscuring the code.

Ok, I'll change the code. This was a hold-over from the Ada 83 idiom,
where the advice I got was that 'address might return the address of the
descriptor in some compilers. One more place where I should have read
the relevant Ada 95 RM first!

-- Stephe




  reply	other threads:[~1998-01-07  0:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-05  0:00 ObjectAda: LPCSTR -> STRING ? matthew_snyder
1998-01-06  0:00 ` Martin C. Carlisle
1998-01-11  0:00   ` Jerry van Dijk
1998-01-12  0:00   ` Pascal Obry
1998-01-06  0:00 ` Robin Stephe Nora
1998-01-06  0:00   ` Robert Dewar
1998-01-07  0:00     ` Stephen Leake [this message]
  -- strict thread matches above, loose matches on Subject: below --
1998-01-20  0:00 matthew_snyder
1998-01-21  0:00 ` Pascal Obry
replies disabled

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