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!news2.google.com!atl-c05.usenetserver.com!news.usenetserver.com!cycny01.gnilink.net!cyclone1.gnilink.net!spamkiller.gnilink.net!gnilink.net!trnddc03.POSTED!20ae255c!not-for-mail Newsgroups: comp.lang.ada From: Anonymous Coward Subject: Re: changing alignment of built-in boolean References: <1129320236.007525.185300@g44g2000cwa.googlegroups.com> Message-Id: User-Agent: slrn/0.9.7.4 (Linux) Date: Wed, 09 Nov 2005 03:25:51 GMT NNTP-Posting-Host: 141.149.78.234 X-Complaints-To: abuse@verizon.net X-Trace: trnddc03 1131506751 141.149.78.234 (Tue, 08 Nov 2005 22:25:51 EST) NNTP-Posting-Date: Tue, 08 Nov 2005 22:25:51 EST Xref: g2news1.google.com comp.lang.ada:6312 Date: 2005-11-09T03:25:51+00:00 List-Id: In article , Jeffrey R. Carter wrote: > > 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: > > B : Big_Boolean; > > if B then ... > > while B loop ... > > exit Some_Loop when B; I tried this, and where I had problems was trying to assign the result of a boolean expression to Big_Boolean. ie. Compiling: procedure Big_Boolean_Experiment is type Big_Boolean_Type is new Boolean; --The following line is probably useless on booleans: pragma Convention (Convention => C, Entity => Big_Boolean_Type); for Big_Boolean_Type'Size use 32; Big_Boolean : Big_Boolean_Type; Native_Boolean : Boolean; begin Big_Boolean := 2=2; --gnat rejects this line Native_Boolean := 2=2; end Big_Boolean_Experiment; results in this error from gnat: $ gcc -c -gnatR3 big_boolean_experiment.adb big_boolean_experiment.adb:14:23: expected type "Big_Boolean_Type" defined at line 3 big_boolean_experiment.adb:14:23: found type "Standard.Boolean" $ gcc --version gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)