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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,334f9012742e58fc X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder.news-service.com!tudelft.nl!txtfeed1.tudelft.nl!zen.net.uk!dedekind.zen.co.uk!aioe.org!not-for-mail From: anon@anon.org Newsgroups: comp.lang.ada Subject: Re: Gnat GPL 2010 available soon Date: Sun, 27 Jun 2010 03:33:34 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: References: <2010061621145016807-sjs@essexacuk> Reply-To: anon@anon.org NNTP-Posting-Host: JEX5xdEi159CR1L5+EIiVw.user.speranza.aioe.org X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: IBM NewsReader/2 2.0 Xref: g2news2.google.com comp.lang.ada:12915 Date: 2010-06-27T03:33:34+00:00 List-Id: In , "lekktu@gmail.com" writes: >On Jun 26, 11:04=A0pm, a...@anon.org wrote: > >> Now, to compile the Ada system this statement type must work because it >> is embeded in a number of locations in the Ada.Text_IO.adb and other >> Ada system packages. > >Yes. Conditional expressions do not fail everywhere. In this specific >case, both Dir & '\' and the fact that Dir is a function argument are >required to trigger the bug. > >> So, first, try compiling without the "-gnat12" switch. >[...] >> Last, if you have or still have GNAT 2009 try compiling using 2009: > >I've already reported the bug, so I'll let them (AdaCore) do the >debugging... The compiler blowing up is an error, but, there are always a way around that type of error, if you find the correct syntax. Try adding parenthesis around the output, since the compiler may see the "Dir" as value and the " & '\'" as extra not part of the statement. function Validate (Dir : in String) return String is begin return (if Dir (Dir'Last) = '\' then Dir else (Dir & '\')); end Validate; And until the Ada2012 RM or documentation/examples come out from Adacore, its anyone guess on the true syntax of all additional statements. Unless you want to spend time in reading the though the gnat Ada compiler. now, in taking a quick look at "par_ch4.adb", Adacore did add that "gnat12" only switch to use the following features: 1. conditional expression -- statement must be parenthesized. (if X then Opt1 else Opt2) where Opt1 and Opt2 must be a function or variable -- the following two addition are not in the documentation, yet! 2. case expression -- statement must be parenthesized. assuming syntax is like conditional expression (case X when Opt1 => Val1 when Opt2 => Val2 when others => Val2) where Val1 and Val2 must be a function or variable 3. from RM 4.5.2 Relational Operators and Membership Tests Now allows the use of "Vertical_Bar" in Membership Tests assuming from code syntax N in X .. Y | A .. B | G .. K