From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f495c7652c09dd8c X-Google-Attributes: gid103376,public From: Marin David Condic Subject: Re: Does this model work ? Date: 1999/05/17 Message-ID: <37408152.C65D85E8@pwfl.com>#1/1 X-Deja-AN: 479148897 Content-Transfer-Encoding: 7bit Sender: condicma@bogon.pwfl.com References: <373e38e2.31311363@news2.ibm.net> <7hhj6q$cjn$1@nnrp1.deja.com> <01be9ee1$eca9be10$022a6282@dieppe> <373E24C3.D77A6837@easystreet.com> <7hp1g8$f9n$1@cf01.edf.fr> Content-Type: text/plain; charset=us-ascii Organization: Pratt & Whitney Mime-Version: 1.0 Reply-To: diespammer@pwfl.com Newsgroups: comp.lang.ada Date: 1999-05-17T00:00:00+00:00 List-Id: 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