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/31052] Bad IOSTAT values when readings NAMELISTs past EOF



------- Comment #23 from anlauf at gmx dot de  2007-03-20 08:51 -------
(In reply to comment #22)
> Error 5001 would be ERROR_OPTION_CONFLICT.  There are 18 different errors
> associated with that code.  To find out which one, you must remove the iostat
> from the offending line so that gfortran will print the error message for you.

OK, this is what I get with iostat removed and compiled with -fbacktrace:

At line 264 of file ../../../../oo-model/mo_thinning.f90
Fortran runtime error: Missing format for FORMATTED data transfer

Backtrace for this error:
  + function data_transfer_init (0x89C9B92)
    at line 1806 of file transfer.c
  + function __mo_thinning__read_nml_thin (0x83570AC)
    at line 264 of file mo_thinning.f90
[...]

The code in question does a:
    rewind (nnml)
[...]
    call position_nml (nnml, 'THINNING', ...)
[...]
    read (nnml, nml=THINNING)     ! This is line 264

The read is only executed when the position_nml succeeds.

> Another option is to use iomsg and get the string.

Thanks, I did not know this F2003 feature.  In that case I get for

          iomsg = ""
          read (nnml, nml=THINNING, iostat=ios, iomsg=iomsg)

the following output:

 iostat =        5001
 iomsg  = Missing format for FORMATTED data transfer                            

No crash, of course, at least in the read statement.

> You can access the code base at gcc.gnu.org/viewcvs or better,

I will bookmark that.

> download with
> anonymous svn.  See instructions here: http://gcc.gnu.org/svn.html.  If you do
> the svn approach, its very simple to get latest update and you are a few
> keystrokes from building it yourself. :)

My next computer and internet connection will probably be
powerful enough. ;-)


-- 


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


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