This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Re: iostat


Hello,

Steve Kargl wrote:
> If we do this (and I'm not necessarily opposed to better error
> messages), then I think we should add new (nonstandard) intrinsic
> procedure, say, iostat_to_msg().  This would be much easier to
> document, and avoids having to list errno values in gfortran.texi,
> and does require gfortran user to gravel through C code/headers.

How about just having the normal ERRNO numbers as iostat? (I thought
this was already the case; as it is not, I'm really in favour to change
it to returning the ERRNO.)

However, I don't see any advantage of adding another compiler specific
intrinsic subroutine.

Reasoning:
- The number you get for free. Any F77 compiler support iostat,
  which you can then print out:
  if(ios /= 0) then
     print *, 'Could not open file (error ',iostat,')'
  end
  Thus you can remain portable and still get some debug information
  if something goes wrong.

- But, if you want to use iostat_to_msg, your program is no longer
  portable. Well, in this case you could use iomsg right away
  as this is already supported by a couple existing Fortran 95+
  compilers, including gfortran 4.1.x and 4.2.x.

Or do I miss something and there is really a need for another intrinsic
subroutine?

Tobias


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