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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,36c197595b07e443 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.glorb.com!feeder.erje.net!news.mixmin.net!aioe.org!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Cross-platform issues Date: Tue, 8 Dec 2009 00:33:04 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: +ERTOT2Y9KJRZ8n+NpAZGA.user.aioe.org X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.0 X-Newsreader: Tom's custom newsreader Cancel-Lock: sha1:1WHbWF3dsZGPRaZv6DmRlmYMa4I= Xref: g2news1.google.com comp.lang.ada:8342 Date: 2009-12-08T00:33:04+00:00 List-Id: > closely as possible to the one that inspired it. The original > emits trace data with things like field length info in 4-byte > integers, for example. I suppose that using a derived type to > ensure that in my implementation those fields conform with the > original is one way to do it, but is that accepted practice, or > is there a more usual one? Representation clauses and pragmas let you specify machine characteristics, for instance that a particular field is 4 bytes long. Types, and derived types, generally have to do with the logical nature of the data eg type Field_Lengths is range 1 .. 64; type Water_Temperatures is range 32 .. 212; type Car_Mileages is range 0 .. 400_000; etc An item of any of those types would fit in a four byte field, even though the first two types could fit in a single byte. In the absence of a representation clause, the compiler is allowed to choose whatever it likes. If you want something *represented* the same on two different machines, or via two different compilers, use representation clauses.