"DrPi" <314@drpi.fr> wrote in message news:6005e946$0$13558$426a74cc@news.free.fr... > 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. That sounds like a bug, I don't think data is supposed to be ignored because of a too-small Size clause (instead, the program ought to be rejected). Randy.