Question on run time error codes
Jerry DeLisle
jvdelisle@verizon.net
Tue Sep 13 06:00:00 GMT 2005
I have been adding some runtime error checks to the arrayio routines and I have
a question.
How do I make an error code accessible at run time as meaningful. For example
if I use IOSTAT=ierr in a write statement, I can test for ierr=13, which is
processor dependent. But if we add an error code, that number may change and
impact previous files.
Are the error names ERROR_WHATEVER accessible at run time by some method?
Is it policy to always add new codes to the end of the list so that all previous
codes are not changed? see example from libgfortran.f where I am adding the
array stride error:
typedef enum
{
ERROR_FIRST = -3, /* Marker for the first error. */
ERROR_EOR = -2,
ERROR_END = -1,
ERROR_OK = 0, /* Indicates success, must be zero. */
ERROR_OS, /* Operating system error, more info in errno. */
ERROR_OPTION_CONFLICT,
ERROR_BAD_OPTION,
ERROR_MISSING_OPTION,
ERROR_ALREADY_OPEN,
ERROR_BAD_UNIT,
ERROR_FORMAT,
ERROR_BAD_ACTION,
ERROR_ENDFILE,
ERROR_BAD_US,
ERROR_READ_VALUE,
ERROR_READ_OVERFLOW,
ERROR_ARRAY_STRIDE,
ERROR_LAST /* Not a real error, the last error # + 1. */
}
error_codes;
Thanks for any suggestions,
Jerry
More information about the Fortran
mailing list