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,f7c38a023cf370dc X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: BrianG Newsgroups: comp.lang.ada Subject: Re: Should representation clauses be complete for each bit? Date: Sun, 31 Jul 2011 11:02:04 -0400 Organization: A noiseless patient Spider Message-ID: References: <73c10395-ec4f-4a02-b0fc-e35bc14424fa@e18g2000vbx.googlegroups.com> <4e26f324$0$6549$9b4e6d93@newsspool4.arcor-online.net> <4e27f4ba$0$6584$9b4e6d93@newsspool3.arcor-online.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 31 Jul 2011 15:02:05 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="+/00p+jVGrXxx+uGTNGMpQ"; logging-data="14500"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX190qNJKeO4d9I/Wrzwkh60r" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110617 Thunderbird/3.1.11 In-Reply-To: Cancel-Lock: sha1:vYQaZfcTN0YO2+3EdWkSDKUU5jI= Xref: g2news1.google.com comp.lang.ada:20434 Date: 2011-07-31T11:02:04-04:00 List-Id: On 07/21/2011 11:06 AM, Robert A Duff wrote: > Georg Bauhaus writes: > >> More specifically, if the original example of "not all bits used and some >> gaps between them" is unusual, is it so >> >> - when mapping to a set of hardware pins, say? > > Whenever I see documentation for such things, they have rectangular pictures > showing what every bit means. They don't have implicit gaps. If there > are any gaps, they are shown explicitly, as "must be zero" or "reserved > for future hardware extensions" or whatever. > > My claim is that the Ada code interfacing to such a thing should be > similarly explicit about the gaps. > > Otherwise, you end up with nasty bugs: one compiler just happens to > set the gaps to zero, and you write to a file, and binary comparisons > of those files work. Then you port to a different compiler, and it > puts arbitrary junk in the gaps. It doesn't have to be a different compiler, or even a different version - this can happen with host/target. For instance, Windows and VxWorks always seem to be exact opposites on these kind of things. Makes coding standards and such rather important. BrianG 000 @gmail.com [test email, trying to re-set-up account]