diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2007-05-06 22:32:33 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2007-05-06 22:32:33 +0000 |
commit | f96d606f3a2b4cb25486d8c7dac01be2d4963e00 (patch) | |
tree | 692f8a6ad04a87c1f8a06248b56be1c7dde36e8f /gcc/fortran/gfortran.h | |
parent | cb13c28858b9c5c243241121206578b5f9f2827c (diff) | |
download | gcc-f96d606f3a2b4cb25486d8c7dac01be2d4963e00.zip gcc-f96d606f3a2b4cb25486d8c7dac01be2d4963e00.tar.gz gcc-f96d606f3a2b4cb25486d8c7dac01be2d4963e00.tar.bz2 |
re PR fortran/31201 (Too large unit number generates wrong code)
2007-05-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/31201
* gfortran.h: Add runtime error codes from libgfortran.h. Define
MAX_UNIT_NUMBER.
* trans.c (gfc_trans_runtime_check): Update the format of runtime error
messages to match library runtime errors. Use call to new library
function runtime_error_at().
* trans.h: Add prototype for new function gfc_trans_io_runtime_check.
Add declaration for library functions runtime_error_at and
generate_error.
* trans_io.c (gfc_trans_io_runtime_check): New function.
(set_parameter_value): Add error checking for UNIT numbers.
(set_parameter_ref): Initialize the users variable to zero.
(gfc_trans_open): Move setting of unit number to after setting of common
flags so that runtime error trapping can be detected.
(gfc_trans_close): Likewise. (build_filepos): Likewise.
(gfc_trans_inquire): Likewise. (build_dt): Likewise.
* trans-decl.c: Add declarations for runtime_error_at and
generate_error. (gfc_build_builtin_function_decls): Build function
declarations for runtime_error_at and generate_error.
Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
From-SVN: r124480
Diffstat (limited to 'gcc/fortran/gfortran.h')
-rw-r--r-- | gcc/fortran/gfortran.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 039c1ee..df0896d 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -472,6 +472,39 @@ enum gfc_generic_isym_id }; typedef enum gfc_generic_isym_id gfc_generic_isym_id; +/* Runtime errors. The EOR and EOF errors are required to be negative. + These codes must be kept synchronized with their equivalents in + libgfortran/libgfortran.h . */ + +typedef enum +{ + IOERROR_FIRST = -3, /* Marker for the first error. */ + IOERROR_EOR = -2, + IOERROR_END = -1, + IOERROR_OK = 0, /* Indicates success, must be zero. */ + IOERROR_OS = 5000, /* Operating system error, more info in errno. */ + IOERROR_OPTION_CONFLICT, + IOERROR_BAD_OPTION, + IOERROR_MISSING_OPTION, + IOERROR_ALREADY_OPEN, + IOERROR_BAD_UNIT, + IOERROR_FORMAT, + IOERROR_BAD_ACTION, + IOERROR_ENDFILE, + IOERROR_BAD_US, + IOERROR_READ_VALUE, + IOERROR_READ_OVERFLOW, + IOERROR_INTERNAL, + IOERROR_INTERNAL_UNIT, + IOERROR_ALLOCATION, + IOERROR_DIRECT_EOR, + IOERROR_SHORT_RECORD, + IOERROR_CORRUPT_FILE, + IOERROR_LAST /* Not a real error, the last error # + 1. */ +} +ioerror_codes; + + /************************* Structures *****************************/ /* Used for keeping things in balanced binary trees. */ |