public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/44697]  New: I/O testsuite failures: \r\n vs \n -  gfortran.dg/ftell_3.f90
@ 2010-06-28 16:31 burnus at gcc dot gnu dot org
  2010-06-28 17:59 ` [Bug fortran/44697] " ktietz at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-06-28 16:31 UTC (permalink / raw)
  To: gcc-bugs

As reported by Kai Tietz, the testsuite fails under MinGW64 due to the \r\n vs.
\n line breaks:


Possible patch for ftell_3.f90 (created for PR 43605):

Index: ftell_3.f90
===================================================================
--- ftell_3.f90 (revision 161500)
+++ ftell_3.f90 (working copy)
@@ -15,3 +15,4 @@ program ftell_3
   call ftell(10, i)
-  if(i /= 7) then
+! Expected: On '\n' systems: 7, on \r\n systems: 8
+  if(i /= 7 .and. i /= 8) then
      call abort()
@@ -23,3 +24,4 @@ program ftell_3
   call ftell(10,i)
-  if (i /= 11) then
+! Expected: On '\n' systems: 11, on \r\n systems: 13
+  if (i /= 11 .and. i /= 13) then
      call abort()


-- 
           Summary: I/O testsuite failures: \r\n vs \n -
                    gfortran.dg/ftell_3.f90
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44697


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/44697] I/O testsuite failures: \r\n vs \n -  gfortran.dg/ftell_3.f90
  2010-06-28 16:31 [Bug fortran/44697] New: I/O testsuite failures: \r\n vs \n - gfortran.dg/ftell_3.f90 burnus at gcc dot gnu dot org
@ 2010-06-28 17:59 ` ktietz at gcc dot gnu dot org
  2010-07-11 20:30 ` jvdelisle at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ktietz at gcc dot gnu dot org @ 2010-06-28 17:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from ktietz at gcc dot gnu dot org  2010-06-28 17:59 -------
Yes, suggested patch works fine for me


-- 

ktietz at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ktietz at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44697


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/44697] I/O testsuite failures: \r\n vs \n -  gfortran.dg/ftell_3.f90
  2010-06-28 16:31 [Bug fortran/44697] New: I/O testsuite failures: \r\n vs \n - gfortran.dg/ftell_3.f90 burnus at gcc dot gnu dot org
  2010-06-28 17:59 ` [Bug fortran/44697] " ktietz at gcc dot gnu dot org
@ 2010-07-11 20:30 ` jvdelisle at gcc dot gnu dot org
  2010-07-20  4:36 ` jvdelisle at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2010-07-11 20:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jvdelisle at gcc dot gnu dot org  2010-07-11 20:30 -------
I will commit a similar patch, but I would like to add a check for the specific
line ends to make sure we don't get a NULL character inserted some day.


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jvdelisle at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-07-11 20:30:42
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44697


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/44697] I/O testsuite failures: \r\n vs \n -  gfortran.dg/ftell_3.f90
  2010-06-28 16:31 [Bug fortran/44697] New: I/O testsuite failures: \r\n vs \n - gfortran.dg/ftell_3.f90 burnus at gcc dot gnu dot org
  2010-06-28 17:59 ` [Bug fortran/44697] " ktietz at gcc dot gnu dot org
  2010-07-11 20:30 ` jvdelisle at gcc dot gnu dot org
@ 2010-07-20  4:36 ` jvdelisle at gcc dot gnu dot org
  2010-07-20 20:01 ` burnus at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2010-07-20  4:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jvdelisle at gcc dot gnu dot org  2010-07-20 04:35 -------
Kai, would you test this for me please.

Index: ftell_3.f90
===================================================================
--- ftell_3.f90 (revision 162291)
+++ ftell_3.f90 (working copy)
@@ -3,9 +3,10 @@
 ! Contributed by Janne Blomqvist, Manfred Schwarb
 ! and Dominique d'Humieres.
 program ftell_3
-  integer :: i
+  integer :: i, j
+  character(1) :: ch
   character(len=99) :: buffer
-  open(10, form='formatted', status='scratch', position='rewind')
+  open(10, form='formatted', position='rewind')
   write(10, '(a)') '123456'
   write(10, '(a)') '789'
   write(10, '(a)') 'CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC'
@@ -13,16 +14,29 @@
   rewind(10)
   read(10, '(a)') buffer
   call ftell(10, i)
-  if(i /= 7) then
-     call abort()
+! Expected: On '\n' systems: 7, on \r\n systems: 8
+  if(i /= 7 .and. i /= 8) then
+    call abort
   end if
   read(10,'(a)') buffer
   if (trim(buffer) /= "789") then
      call abort()
   end if
-  call ftell(10,i)
-  if (i /= 11) then
-     call abort()
+  call ftell(10,j)
+  close(10)
+  open(10, access="stream")
+! Expected: On '\n' systems: 11, on \r\n systems: 13
+  if (i == 7) then
+    read(10, pos=7) ch
+    if (ch /= char(10)) call abort
+    if (j /= 11) call abort
   end if
-  close(10)
+  if (i == 8) then
+    read(10, pos=7) ch
+    if (ch /= char(13)) call abort
+    read(10) ch
+    if (ch /= char(10)) call abort
+    if (j /= 13) call abort
+  end if
+  close(10, status="delete")
 end program ftell_3


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44697


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/44697] I/O testsuite failures: \r\n vs \n -  gfortran.dg/ftell_3.f90
  2010-06-28 16:31 [Bug fortran/44697] New: I/O testsuite failures: \r\n vs \n - gfortran.dg/ftell_3.f90 burnus at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2010-07-20  4:36 ` jvdelisle at gcc dot gnu dot org
@ 2010-07-20 20:01 ` burnus at gcc dot gnu dot org
  2010-07-21  4:21 ` jvdelisle at gcc dot gnu dot org
  2010-07-21  4:25 ` jvdelisle at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-07-20 20:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from burnus at gcc dot gnu dot org  2010-07-20 20:01 -------
(In reply to comment #3)
> Kai, would you test this for me please.

Kai wrote in IRC that he has tested it - and it worked well.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44697


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/44697] I/O testsuite failures: \r\n vs \n -  gfortran.dg/ftell_3.f90
  2010-06-28 16:31 [Bug fortran/44697] New: I/O testsuite failures: \r\n vs \n - gfortran.dg/ftell_3.f90 burnus at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2010-07-20 20:01 ` burnus at gcc dot gnu dot org
@ 2010-07-21  4:21 ` jvdelisle at gcc dot gnu dot org
  2010-07-21  4:25 ` jvdelisle at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2010-07-21  4:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jvdelisle at gcc dot gnu dot org  2010-07-21 04:21 -------
Subject: Bug 44697

Author: jvdelisle
Date: Wed Jul 21 04:20:58 2010
New Revision: 162362

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162362
Log:
2010-07-20  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

        PR libfortran/44697
        * gfortran.dg/ftell_3.f90: Take care of cr-lf record endings.

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/ftell_3.f90


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44697


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug fortran/44697] I/O testsuite failures: \r\n vs \n -  gfortran.dg/ftell_3.f90
  2010-06-28 16:31 [Bug fortran/44697] New: I/O testsuite failures: \r\n vs \n - gfortran.dg/ftell_3.f90 burnus at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2010-07-21  4:21 ` jvdelisle at gcc dot gnu dot org
@ 2010-07-21  4:25 ` jvdelisle at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2010-07-21  4:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jvdelisle at gcc dot gnu dot org  2010-07-21 04:25 -------
Closing.


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44697


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-07-21  4:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-28 16:31 [Bug fortran/44697] New: I/O testsuite failures: \r\n vs \n - gfortran.dg/ftell_3.f90 burnus at gcc dot gnu dot org
2010-06-28 17:59 ` [Bug fortran/44697] " ktietz at gcc dot gnu dot org
2010-07-11 20:30 ` jvdelisle at gcc dot gnu dot org
2010-07-20  4:36 ` jvdelisle at gcc dot gnu dot org
2010-07-20 20:01 ` burnus at gcc dot gnu dot org
2010-07-21  4:21 ` jvdelisle at gcc dot gnu dot org
2010-07-21  4:25 ` jvdelisle at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).