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!cleanfeed3-b.proxad.net!nnrp1-2.free.fr!not-for-mail Newsgroups: comp.lang.ada References: <5ff9779d$0$24281$426a74cc@news.free.fr> <5ffb311f$0$16185$426a74cc@news.free.fr> <5ffb7135$0$24247$426a74cc@news.free.fr> <5ffc8efd$0$8957$426a74cc@news.free.fr> <60004212$0$13563$426a34cc@news.free.fr> From: DrPi <314@drpi.fr> Subject: Re: Record initialisation question Date: Fri, 15 Jan 2021 08:49:32 +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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Message-ID: <6001490d$0$24269$426a74cc@news.free.fr> Organization: Guest of ProXad - France NNTP-Posting-Date: 15 Jan 2021 08:49:33 CET NNTP-Posting-Host: 82.65.30.55 X-Trace: 1610696973 news-1.free.fr 24269 82.65.30.55:55531 X-Complaints-To: abuse@proxad.net Xref: reader02.eternal-september.org comp.lang.ada:61135 List-Id: > > You could try Unchecked_Conversion or System.Storage_Units.To_Integer. > They are not compatible with no elaboration code. Generally, using a function call is not compatible with no elaboration code. > But my suggestion did not involve such conversions: I assumed that you > would be able to compute, using static universal-integer expressions, > the addresses for all your flash objects, and use those directly in the > record aggregates. This assumes that you are able to define the lay-out > of all the stuff in the flash. You might then also specify the 'Address > of each flash object, using those same universal-integer expressions. > > Something like this (not tested with a compiler): > >    Flash_Start : constant := 16#500#; > >    Obj_A_Addr : constant := Flash_Start; > >    Obj_B_Addr : constant := Obj_A_Addr + 16#234#; >    -- Here 16#234# is supposed to be the size of Obj_A, so that >    -- Obj_B follows Obj_A in flash. > >    Obj_A : constant Dcd_T := ( >       Next => Obj_B_Addr, >       ...); > >    for Obj_A'Address >       use System.Storage_Elements.To_Address (Obj_A_Addr); > System.Storage_Elements is not compatible with no elaboration code.