User account creation filtered due to spam.

Bug 34564 - Reading zero variables from a zero-sized file fails
Summary: Reading zero variables from a zero-sized file fails
Status: RESOLVED WORKSFORME
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-code
Depends on:
Blocks: 32834
  Show dependency treegraph
 
Reported: 2007-12-23 11:36 UTC by Tobias Burnus
Modified: 2007-12-23 18:08 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Burnus 2007-12-23 11:36:08 UTC
More bugs found via the test suite.

implicit none
integer :: ios
open(9,file='tmp.dat',status='REPLACE')
write(9,'(a)',advance='NO')
close(9)
open(9,FILE='tmp.dat',status='OLD',position='REWIND')
read(9,'(a)',ADVANCE='NO',iostat=ios)
if(ios /= 0) print *, 'ERROR: Expected ios = 0, got: ios = ', ios
read(9,'(a)',ADVANCE='NO',iostat=ios)
if(ios /= 0) print *, 'ERROR: Expected ios = 0, got: ios = ', ios
close(9, status='delete')
END
Comment 1 Dominique d'Humieres 2007-12-23 12:23:53 UTC
I am not sure to understand what this test is supposed to do for the "standard" behavior. If it is supposed to pass without giving any output, then it succeeds for both ppc/Intel Darwin9. Otherwise I don't know what to expect.
Comment 2 Jerry DeLisle 2007-12-23 16:55:08 UTC
This works for me on x86-64 with gfortran and ifort. Sun f95 fails.  
Comment 3 Tobias Burnus 2007-12-23 18:08:13 UTC
CLOSE as works for me.
It fails with 4.2 and 4.3.0 20071129, but it works with 4.3.0 20071221. Seemingly I did not check properly with the newer gfortran. (The test was run with an older gfortran and seemingly I failed to recheck with the newer.)