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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.129.82.76 with SMTP id g73mr13684008ywb.57.1454150585959; Sat, 30 Jan 2016 02:43:05 -0800 (PST) X-Received: by 10.182.66.12 with SMTP id b12mr3739obt.1.1454150585912; Sat, 30 Jan 2016 02:43:05 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!94no8198737qgt.1!news-out.google.com!kr2ni1460igb.0!nntp.google.com!h5no662639igh.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 30 Jan 2016 02:43:05 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=91.55.220.218; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf NNTP-Posting-Host: 91.55.220.218 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Out_File , excess line From: AdaMagica Injection-Date: Sat, 30 Jan 2016 10:43:05 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Received-Bytes: 2906 X-Received-Body-CRC: 904472762 Xref: news.eternal-september.org comp.lang.ada:29291 Date: 2016-01-30T02:43:05-08:00 List-Id: Am Samstag, 30. Januar 2016 10:44:26 UTC+1 schrieb Simon Wright: > comicfanzine@gmail.com writes: That's about what what I've pointed him to in the very first answer to his post. Also my next posts tried to explain him the case. There really is no second line, there only is one empty line ending in . > ARM A.10.2(3)[1] says > > For the procedure Close: If the file has the current mode Out_File or > Append_File, has the effect of calling New_Page, unless the current > page is already terminated; then outputs a file terminator. > > ARM A.10.5(15)[2] says > > procedure New_Page(File : in File_Type); > procedure New_Page; > > Operates on a file of mode Out_File or Append_File. Outputs a line > terminator if the current line is not terminated, or if the current > page is empty (that is, if the current column and line numbers are > both equal to one). Then outputs a page terminator, which terminates > the current page. Adds one to the current page number and sets the > current column and line numbers to one. > > So, if you open a file in Out_File mode, the current (empty) line is not > terminated, and when you close the file and New_Page is called (or > possibly simulated), a line terminator is added. > > You would expect a page terminator (FF) to be added as well; indeed, if > you call New_Page explicitly and then close the file GNAT does. I > suspect that the reason GNAT doesn't do this in the case of just closing > a file with an unterminated line is that that would be very surprising > indeed! > > See Terminate_Line in a-textio.adb. > > [1] http://www.ada-auth.org/standards/12rm/html/RM-A-10-2.html#p3 > [2] http://www.ada-auth.org/standards/12rm/html/RM-A-10-5.html#p15