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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,139d9b90ab37c0e5 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-26 06:57:42 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!paloalto-snf1.gtei.net!news.gtei.net!enews.sgi.com!newshub2.rdc1.sfba.home.com!news.home.com!news1.sttln1.wa.home.com.POSTED!not-for-mail From: "DuckE" Newsgroups: comp.lang.ada References: <3BD91EF8.EEB7EDBA@systems.saab.se> Subject: Re: When to do a constraint check and not ?? X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: Date: Fri, 26 Oct 2001 13:57:42 GMT NNTP-Posting-Host: 24.248.45.203 X-Complaints-To: abuse@home.net X-Trace: news1.sttln1.wa.home.com 1004104662 24.248.45.203 (Fri, 26 Oct 2001 06:57:42 PDT) NNTP-Posting-Date: Fri, 26 Oct 2001 06:57:42 PDT Organization: Excite@Home - The Leader in Broadband http://home.com/faster Xref: archiver1.google.com comp.lang.ada:15240 Date: 2001-10-26T13:57:42+00:00 List-Id: I'm not sure about the "rules" but... I used a tool to translate a bunch of Pascal code to Ada. The tool turned "var" parameters into "in out" parameters. Your example illustrates the problem with that mapping. We went through the translated code and depending on which made more sense: either initialized the variable prior to the call: b : boolean := FALSE; or changed the mode of the procedure parameter to "out": procedure test( p : out boolean ) is Without these changes both GNAT and ObjectAda raise exceptions. SteveD "Per Sandberg" wrote in message news:3BD91EF8.EEB7EDBA@systems.saab.se... > Assume the folowing code: > > procedue bla is > b : boolean; --< B may contain any bit pattern at this point. > > procedure test( p : in out boolean ) is > begin > b := false; > end test; > > begin > test(b); --<< Is the compiler allowed to insert a constraint check on b > here ?? > end; > > Is the answer that it is up to the wendor. > I did not get any clues from the LRM. > > /Per Sandberg.