comp.lang.ada
 help / color / mirror / Atom feed
From: Marin David Condic <condicma@bogon.pwfl.com>
Subject: Re: Does this model work ?
Date: 1999/05/17
Date: 1999-05-17T00:00:00+00:00	[thread overview]
Message-ID: <37408152.C65D85E8@pwfl.com> (raw)
In-Reply-To: 7hp1g8$f9n$1@cf01.edf.fr

Pascal Obry wrote:
> 
> I don't find this impertinent at all. In fact this is really a good
> question.
> Given that I do not use low level construct like rep clauses in my
> sources, I expect that all the Ada source on my Web page will
> compile and works fine under any 64 bits compiler.
> 
Avoiding representation clauses is probably a poor choice if portability
is a concern. Rep clauses might, in fact, guarantee that your software
works in a switch to a 64 bit architecture. For example, the current
implementation uses for the standard type Integer a 32 bit integer. On
some hypothetical 64 bit machine, an Ada implementation uses 64 bits for
the type Integer. No big problem for most internal computations, but
suppose you have a record type with an Integer in it and this is being
output to a file. Suddenly, your record consumes 32 more bits and your
software is not compatible with files produced earlier. Any new files
may not be compatible with other software products as well.

Whereas, if you scrupulously use representation clauses to specify the
exact size of things you need, you have a guarantee that the compiler
will give you that - or at least warn you that it can't & let you fix
it. I don't use precisely sized types for everything because obviously
there are plenty of coding situations where it just plain will never
matter, but where I think there may be an issue of portability or
compatibility with external systems, I use the rep clauses. You might
take a look at my web site where I have some utility code posted. I have
a package which defines a bunch of pre-fabricated types which I use in
building other things just to be sure I have control over the size - and
potentially the operations as well.

MDC
-- 
Marin David Condic
Real Time & Embedded Systems, Propulsion Systems Analysis
United Technologies, Pratt & Whitney, Large Military Engines
M/S 731-95, P.O.B. 109600, West Palm Beach, FL, 33410-9600
***To reply, remove "bogon" from the domain name.***

Visit my web page at: http://www.flipag.net/mcondic




  reply	other threads:[~1999-05-17  0:00 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-05-14  0:00 Does this model work ? Jean-Marten Marchi
1999-05-14  0:00 ` dennison
     [not found]   ` <01be9ee1$eca9be10$022a6282@dieppe>
1999-05-15  0:00     ` Al Christians
1999-05-16  0:00       ` Larry Kilgallen
1999-05-16  0:00       ` Robert Dewar
1999-05-17  0:00       ` Pascal Obry
1999-05-17  0:00         ` Marin David Condic [this message]
1999-05-20  0:00           ` Robert Dewar
1999-05-20  0:00             ` Marin David Condic
1999-05-16  0:00     ` Jean-Marten Marchi
1999-05-16  0:00   ` Robert Dewar
1999-05-16  0:00     ` Andi Kleen
1999-05-17  0:00       ` Robert Dewar
1999-05-17  0:00     ` jrcarter001
1999-05-17  0:00       ` Robert Dewar
1999-05-18  0:00     ` dennison
1999-05-19  0:00       ` Robert Dewar
1999-05-19  0:00         ` dennison
1999-05-14  0:00 ` Al Christians
1999-05-14  0:00   ` Jean-Marten Marchi
1999-05-16  0:00     ` Robert Dewar
1999-05-16  0:00       ` Jean-Marten Marchi
1999-05-17  0:00       ` Roger Racine
1999-05-14  0:00   ` Jean-Marten Marchi
1999-05-15  0:00     ` Florian Weimer
1999-05-15  0:00       ` bglbv
1999-05-16  0:00         ` Tom Moran
1999-05-16  0:00       ` Robert Dewar
1999-05-16  0:00       ` David Botton
1999-05-16  0:00         ` Robert Dewar
1999-05-16  0:00 ` Robert Dewar
1999-05-16  0:00   ` Jean-Marten Marchi
1999-05-17  0:00     ` Robert Dewar
1999-05-17  0:00       ` Jean-Marten Marchi
1999-05-18  0:00         ` Samuel T. Harris
1999-05-20  0:00           ` Jean-Marten Marchi
1999-05-20  0:00             ` Samuel Mize
1999-05-20  0:00               ` David Botton
1999-05-20  0:00                 ` Samuel Mize
1999-05-20  0:00             ` Samuel T. Harris
1999-05-17  0:00       ` Jean-Marten Marchi
1999-05-18  0:00     ` dennison
replies disabled

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