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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,32e730fd939a8067 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!g44g2000cwa.googlegroups.com!not-for-mail From: invalidemail@aerojockey.com Newsgroups: comp.lang.ada Subject: Re: changing alignment of built-in boolean Date: 16 Oct 2005 10:48:15 -0700 Organization: http://groups.google.com Message-ID: <1129484895.726188.61070@g44g2000cwa.googlegroups.com> References: <1129320236.007525.185300@g44g2000cwa.googlegroups.com> NNTP-Posting-Host: 65.29.206.183 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1129484901 28239 127.0.0.1 (16 Oct 2005 17:48:21 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 16 Oct 2005 17:48:21 +0000 (UTC) In-Reply-To: User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050225 Firefox/1.0.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: g44g2000cwa.googlegroups.com; posting-host=65.29.206.183; posting-account=ic31RQwAAADG2g1NjWUVIsXdf0Dq_CbQ Xref: g2news1.google.com comp.lang.ada:5728 Date: 2005-10-16T10:48:15-07:00 List-Id: Jeffrey R. Carter wrote: > invalidemail@aerojockey.com wrote: > > Is it possible, in GNAT, to force the built-in Boolean type to use > > 4-byte (32-bit) alignment? Reason: I have to interface some Ada code > > to a package that insists on 32-bit variables on 4-byte-aligned > > addresses. > > You could always modify the compiler :) > > You might want to look at user-defined boolean types here (it's sometimes a > little confusing in Ada to distinguish between integer types and type Integer, > character types and type Character, string types and type String, boolean types > and type Boolean): > > type Big_Boolean is new Boolean; > for Big_Boolean'Size use 32; > for Big_Boolean'Alignment use 4; > > Conditions can be of any boolean type, so you can use this just like type Boolean: Yes, but there appears to be one little catch: if B and then (Some_Integer /= 0) then ... Unfortunately I got stuff like this all over the Ada code :( Otherwise this would be something I could do with a simple search and replace. Maybe there's a flag to loosen the type checking for this case. Probably not. Oh well. Thanks.