public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/18982] open(status="new") does not generate an error if the file exists
  2004-12-14 13:30 [Bug libfortran/18982] New: open(status="new") does not generate an error if the file exists Thomas dot Koenig at online dot de
@ 2004-12-14 13:30 ` Thomas dot Koenig at online dot de
  2004-12-14 22:13 ` tobi at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Thomas dot Koenig at online dot de @ 2004-12-14 13:30 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From Thomas dot Koenig at online dot de  2004-12-14 13:30 -------
I forget...

$ gfortran -v
Reading specs from /home/zfkts/lib/gcc/ia64-unknown-linux-gnu/4.0.0/specs
Configured with: ../gcc-4.0-20041212/configure --prefix=/home/zfkts
--enable-languages=c,c++,f95
Thread model: posix
gcc version 4.0.0 20041212 (experimental)


-- 


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


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

* [Bug libfortran/18982] New: open(status="new") does not generate an error if the file exists
@ 2004-12-14 13:30 Thomas dot Koenig at online dot de
  2004-12-14 13:30 ` [Bug libfortran/18982] " Thomas dot Koenig at online dot de
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Thomas dot Koenig at online dot de @ 2004-12-14 13:30 UTC (permalink / raw)
  To: gcc-bugs

$ cat open.f90
  nout = 10
  open(nout, file="foo.dat", status="new")
  close(nout)
  open(nout, file="foo.dat", status="new",err=100)  ! This should fail
  write(nout,*) "Hello"                     ! and not this.
100 continue
end
$ rm -f foo.dat
$ gfortran open.f90
$ ./a.out
At line 5 of file open.f90
Fortran runtime error: Cannot write to file opened for READ

-- 
           Summary: open(status="new") does not generate an error if the
                    file exists
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libfortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: Thomas dot Koenig at online dot de
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug libfortran/18982] open(status="new") does not generate an error if the file exists
  2004-12-14 13:30 [Bug libfortran/18982] New: open(status="new") does not generate an error if the file exists Thomas dot Koenig at online dot de
  2004-12-14 13:30 ` [Bug libfortran/18982] " Thomas dot Koenig at online dot de
@ 2004-12-14 22:13 ` tobi at gcc dot gnu dot org
  2005-01-01 22:07 ` Thomas dot Koenig at online dot de
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: tobi at gcc dot gnu dot org @ 2004-12-14 22:13 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-12-14 22:13:28
               date|                            |


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


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

* [Bug libfortran/18982] open(status="new") does not generate an error if the file exists
  2004-12-14 13:30 [Bug libfortran/18982] New: open(status="new") does not generate an error if the file exists Thomas dot Koenig at online dot de
  2004-12-14 13:30 ` [Bug libfortran/18982] " Thomas dot Koenig at online dot de
  2004-12-14 22:13 ` tobi at gcc dot gnu dot org
@ 2005-01-01 22:07 ` Thomas dot Koenig at online dot de
  2005-01-06 14:43 ` tobi at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Thomas dot Koenig at online dot de @ 2005-01-01 22:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From Thomas dot Koenig at online dot de  2005-01-01 22:07 -------
Patch here:

http://gcc.gnu.org/ml/gcc-patches/2005-01/msg00024.html

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


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


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

* [Bug libfortran/18982] open(status="new") does not generate an error if the file exists
  2004-12-14 13:30 [Bug libfortran/18982] New: open(status="new") does not generate an error if the file exists Thomas dot Koenig at online dot de
                   ` (2 preceding siblings ...)
  2005-01-01 22:07 ` Thomas dot Koenig at online dot de
@ 2005-01-06 14:43 ` tobi at gcc dot gnu dot org
  2005-01-12 22:03 ` Thomas dot Koenig at online dot de
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: tobi at gcc dot gnu dot org @ 2005-01-06 14:43 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |19292
              nThis|                            |


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


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

* [Bug libfortran/18982] open(status="new") does not generate an error if the file exists
  2004-12-14 13:30 [Bug libfortran/18982] New: open(status="new") does not generate an error if the file exists Thomas dot Koenig at online dot de
                   ` (3 preceding siblings ...)
  2005-01-06 14:43 ` tobi at gcc dot gnu dot org
@ 2005-01-12 22:03 ` Thomas dot Koenig at online dot de
  2005-01-13 22:14 ` Thomas dot Koenig at online dot de
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Thomas dot Koenig at online dot de @ 2005-01-12 22:03 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From Thomas dot Koenig at online dot de  2005-01-12 22:03 -------
Sligtly updated patch:

http://gcc.gnu.org/ml/gcc-patches/2005-01/msg00675.html

Thomas

-- 


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


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

* [Bug libfortran/18982] open(status="new") does not generate an error if the file exists
  2004-12-14 13:30 [Bug libfortran/18982] New: open(status="new") does not generate an error if the file exists Thomas dot Koenig at online dot de
                   ` (4 preceding siblings ...)
  2005-01-12 22:03 ` Thomas dot Koenig at online dot de
@ 2005-01-13 22:14 ` Thomas dot Koenig at online dot de
  2005-01-17 21:00 ` Thomas dot Koenig at online dot de
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Thomas dot Koenig at online dot de @ 2005-01-13 22:14 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From Thomas dot Koenig at online dot de  2005-01-13 22:14 -------
(In reply to comment #3)
> Sligtly updated patch:

.. which was broken; http://gcc.gnu.org/ml/gcc-patches/2005-01/msg00024.html
was correct (although it fails due to whitespace changes).

This patch does not fix all that's broken, though.  The following
test cases still fail with my patch:

program open_readonly
  call system("touch tst2.dat ; chmod 100 tst2.dat")
  open(unit=10,file="tst2.dat", err=9000)
  goto 30
9000 continue
  print *,"Opening read-only file failed"
  call abort
30 continue
end program open_readonly

program open_writeonly
  call system("touch tst1.dat ; chmod 200 tst1.dat")
  open(unit=10,file="tst1.dat", err=9000)
  goto 30
9000 continue
  print *,"Opening write-only file failed"
  call abort
30 continue
end program open_writeonly

so something else is needed.

I've removed the "patch" keyword.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|patch                       |


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


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

* [Bug libfortran/18982] open(status="new") does not generate an error if the file exists
  2004-12-14 13:30 [Bug libfortran/18982] New: open(status="new") does not generate an error if the file exists Thomas dot Koenig at online dot de
                   ` (5 preceding siblings ...)
  2005-01-13 22:14 ` Thomas dot Koenig at online dot de
@ 2005-01-17 21:00 ` Thomas dot Koenig at online dot de
  2005-01-22 19:49 ` cvs-commit at gcc dot gnu dot org
  2005-01-22 22:33 ` pbrook at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: Thomas dot Koenig at online dot de @ 2005-01-17 21:00 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From Thomas dot Koenig at online dot de  2005-01-17 21:00 -------
New patch:

http://gcc.gnu.org/ml/gcc-patches/2005-01/msg01056.html


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


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


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

* [Bug libfortran/18982] open(status="new") does not generate an error if the file exists
  2004-12-14 13:30 [Bug libfortran/18982] New: open(status="new") does not generate an error if the file exists Thomas dot Koenig at online dot de
                   ` (6 preceding siblings ...)
  2005-01-17 21:00 ` Thomas dot Koenig at online dot de
@ 2005-01-22 19:49 ` cvs-commit at gcc dot gnu dot org
  2005-01-22 22:33 ` pbrook at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-01-22 19:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-01-22 19:49 -------
Subject: Bug 18982

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	pbrook@gcc.gnu.org	2005-01-22 19:49:18

Modified files:
	gcc/testsuite  : ChangeLog 
	libgfortran    : ChangeLog 
	libgfortran/io : unix.c 
Added files:
	gcc/testsuite/gfortran.dg: open_new.f90 

Log message:
	2005-01-22  Thomas Koenig  <Thomas.Koenig@online.de>
	
	PR libfortran/18982
	* io/unix.c (regular_file):  No need to change flags->action
	if an error occurs.  Document this.
	No need to call stat() for STATUS_OLD, open() will
	fail anyway.
	For ACTION_UNSPECIFIED, try open for read-write, then for
	read-only if open fails with EACCES, then for write-only
	if that fails with EACCES again.
	* io/unix.c (open_external): Document changed behavior of
	regular_file.
	testsuite/
	* gfortran.dg/open_new.f90: New file.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4924&r2=1.4925
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/open_new.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/ChangeLog.diff?cvsroot=gcc&r1=1.149&r2=1.150
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/io/unix.c.diff?cvsroot=gcc&r1=1.19&r2=1.20



-- 


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


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

* [Bug libfortran/18982] open(status="new") does not generate an error if the file exists
  2004-12-14 13:30 [Bug libfortran/18982] New: open(status="new") does not generate an error if the file exists Thomas dot Koenig at online dot de
                   ` (7 preceding siblings ...)
  2005-01-22 19:49 ` cvs-commit at gcc dot gnu dot org
@ 2005-01-22 22:33 ` pbrook at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: pbrook at gcc dot gnu dot org @ 2005-01-22 22:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pbrook at gcc dot gnu dot org  2005-01-22 22:33 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.0.0


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


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

end of thread, other threads:[~2005-01-22 22:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-14 13:30 [Bug libfortran/18982] New: open(status="new") does not generate an error if the file exists Thomas dot Koenig at online dot de
2004-12-14 13:30 ` [Bug libfortran/18982] " Thomas dot Koenig at online dot de
2004-12-14 22:13 ` tobi at gcc dot gnu dot org
2005-01-01 22:07 ` Thomas dot Koenig at online dot de
2005-01-06 14:43 ` tobi at gcc dot gnu dot org
2005-01-12 22:03 ` Thomas dot Koenig at online dot de
2005-01-13 22:14 ` Thomas dot Koenig at online dot de
2005-01-17 21:00 ` Thomas dot Koenig at online dot de
2005-01-22 19:49 ` cvs-commit at gcc dot gnu dot org
2005-01-22 22:33 ` pbrook 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).