From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-91-241.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=NICE_REPLY_A autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!news.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Valid attribute and input operations Date: Tue, 26 Sep 2023 10:22:14 +0300 Organization: Tidorum Ltd Message-ID: References: <22930fd1-c7ff-46cf-8c75-892212afa85en@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net uM7TAkFEDMtp4tZ3MGuJnw4Dvk0CX9bc44XKhpB3HbAPNSy5zg Cancel-Lock: sha1:kExowTF0CE+/D0uNgrzoYi5QoqQ= sha256:hXcqadZsOJHwem7y5jVPWPVQZze2GhItDAVKwEKKOao= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Content-Language: en-US In-Reply-To: Xref: news.eternal-september.org comp.lang.ada:65729 List-Id: On 2023-09-26 9:13, Randy Brukardt wrote: > ... for Janus/Ada, enumeration types with specified representations > operate internally on the position numbers Hm, that's interesting. Is that also the representation for record components of such an enumerated type? For example, if I have: type Command is (Off, On) with Size => 4; for Command use (Off => 2, On => 5); type Two_Commands is record C1, C2: Command; end record with Pack, Size => 8; TwoC : Two_Commands := (C1 => On, C2 => Off); will the record components (in memory) have the values C1 = 1 and C2 = 0 (position numbers) or C1 = 5, C2 = 2 (specified representation)? If they are represented by position numbers in the record, many if not most of my embedded Ada programs would fail if compiled with Janus/Ada, because the record values stored in I/O control registers or accessed via DMA would be wrong. Damn, I thought those programs were not so compiler-dependent :-(