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,a0833bbed8752e1f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread3.news.pas.earthlink.net.POSTED!a6202946!not-for-mail From: Jeffrey Carter Organization: jrcarter commercial-at acm [period | full stop] org User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: variable lenght strings References: <1861614.TWv5A9FgVL@linux1.krischik.com> <4178e979_1@baen1673807.greenlnk.net> <1195374.UMjBCk7lO1@linux1.krischik.com> <1154613.ipZcUgduzp@linux1.krischik.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Tue, 26 Oct 2004 17:46:46 GMT NNTP-Posting-Host: 63.184.104.100 X-Complaints-To: abuse@earthlink.net X-Trace: newsread3.news.pas.earthlink.net 1098812806 63.184.104.100 (Tue, 26 Oct 2004 10:46:46 PDT) NNTP-Posting-Date: Tue, 26 Oct 2004 10:46:46 PDT Xref: g2news1.google.com comp.lang.ada:5729 Date: 2004-10-26T17:46:46+00:00 List-Id: Randy Brukardt wrote: > My opinion is that GNAT is wrong in that case. A.10(7) makes it quite > clear that you can't have a file terminator without a line and page > terminator in front of it. Shouldn't that be "... without an implied line ..."? Clearly text files from external sources can lack the explicit terminators, or we wouldn't be having this discussion. FWIW, ObjectAda 7.2.2 SE gives the same behavior. Get_Line successfully reads a non-null line shorter than the string at the end of the file without the line-terminator characters, but fails on a null line at the same place. I can see the logic of that: If you've just skipped the line terminator of the last line, you have the same situation, and an attempt to read should raise End_Error. To get this correct, you have to keep track of what you just read. If it's a line or page terminator, you raise End_Error; if not, you return a null string. Is there any chance the ARG could rule on this, one way or another? Also FWIW, AFAIK PragmARC.Get_Line has been used successfully since 1991 without ever encountering this situation. -- Jeff Carter "Help! Help! I'm being repressed!" Monty Python & the Holy Grail 67