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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Compiler doesn't respect 'Size for atomic object Date: Thu, 21 Dec 2017 14:08:38 +0000 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="7cd9de1895be944a2f440543cc1b68b7"; logging-data="23135"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18g/4HXIfLbl7Kvq/33CyGUsiq9T96+qqE=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (darwin) Cancel-Lock: sha1:giwj4I1ht5xlQOmVZUwlfzy5Kf0= sha1:zg+jrAm/7tM6tuU+Jq6tojQdEFg= Xref: reader02.eternal-september.org comp.lang.ada:49573 Date: 2017-12-21T14:08:38+00:00 List-Id: "Randy Brukardt" writes: > Still, you'll always have less issues if you avoid padding bits and > have the subtype Object_Size (this is now in Ada 2020, so we can talk > about it) be 32. > > Which is something you (Simon Wright, not Simon Clubley) might try, > since Object_Size can be specified for any subtype. So try declaring: > > subype Simons_Interrupt_Id is Interrupt_Id with Object_Size => 32; > > and declare your object of that subtype. Then there are no padding > bits (as defined by 13.1(7.2)). Works a treat! Thanks! (and Object_Size is available in GNAT back to at least 2015)