From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!212.27.60.64.MISMATCH!cleanfeed3-b.proxad.net!nnrp1-2.free.fr!not-for-mail Newsgroups: comp.lang.ada References: <5ff9779d$0$24281$426a74cc@news.free.fr> <60046de5$0$16169$426a74cc@news.free.fr> <709708e9-4964-40a8-b14f-d8bcc0fa5e52n@googlegroups.com> From: DrPi <314@drpi.fr> Subject: Re: Record initialisation question Date: Mon, 18 Jan 2021 21:02:12 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <709708e9-4964-40a8-b14f-d8bcc0fa5e52n@googlegroups.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Message-ID: <6005e946$0$13558$426a74cc@news.free.fr> Organization: Guest of ProXad - France NNTP-Posting-Date: 18 Jan 2021 21:02:14 CET NNTP-Posting-Host: 82.65.30.55 X-Trace: 1611000134 news-3.free.fr 13558 82.65.30.55:52158 X-Complaints-To: abuse@proxad.net Xref: reader02.eternal-september.org comp.lang.ada:61169 List-Id: Le 18/01/2021 à 00:55, Shark8 a écrit : > On Sunday, January 17, 2021 at 10:03:34 AM UTC-7, DrPi wrote: >> >> I had a very bad surprise : Enums are used in some records. One enum did >> not have the Size specified (8 bits). All was working as if it was not >> present except I had to assign it a value. I had to lower the >> Object_Size and the enum was removed from the result (its value was not >> present in memory mapping). After setting Size => 8 to this enum, all >> went well. > > This is not too bad a restriction; simply have two identical-except-for-size types. > NEEDED_SIZE : Constant := 2; > Type Base_Enumeration is (a,b,c); -- Uses defaults. > Type Boot_Enumeration is new Base_Enumeration with Size => NEEDED_SIZE; > That's a clever construct. I have to remember it. In my case I don't need 2 types since the only place the enum is used is in the record which describes the memory mapping. The bad surprise is that the enum is completely discarded from the memory mapping when its size is not specified.