This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libfortran/59419] [4.9 Regression] Failing OPEN with FILE='xxx' and IOSTAT creates the file 'xxx' after revision 196783


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

--- Comment #4 from Janne Blomqvist <jb at gcc dot gnu.org> ---
Indeed I suspect we have many cases in the IO library where stuff fails, leaks
memory, or leaves stuff in an inconsistent state when IOSTAT= is present. 

I think that we should modify generate_error() to not terminate the program in
case IOSTAT= is not present, but instead we return and unwind the IO call stack
(manually with return statements since this is plain old C), and then only at
the end just before we return to the user Fortran program we check
IOPARM_HAS_IOSTAT and IOPARM_LIBRETURN_MASK and exit() if appropriate. That way
error handling works the same whether IOSTAT= is present or not. But such a
change is probably 4.10 material.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]