10This header can be included into both
Fortran and C.
12This file defines various code values that need to be exported
13to predefined
Fortran standard modules as well as to C/C++
14code in the compiler and runtime library.
16 - the error/end code values that can be returned
17 to an IOSTAT= or STAT= specifier on a
Fortran I/O statement
18 or coindexed data reference (see
Fortran 2018 12.11.5,
19 16.10.2, and 16.10.2.33)
20Codes from <errno.h>, e.g. ENOENT, are assumed to be positive
21and are used
"raw" as IOSTAT values.
23CFI_ERROR_xxx and CFI_INVALID_xxx macros from ISO_Fortran_binding.h
24have small positive values. The FORTRAN_RUNTIME_STAT_xxx macros here
25start at 100 so as to never conflict with those codes.
27#ifndef FORTRAN_RUNTIME_MAGIC_NUMBERS_H_
28#define FORTRAN_RUNTIME_MAGIC_NUMBERS_H_
30#define FORTRAN_DEFAULT_OUTPUT_UNIT 6
31#define FORTRAN_DEFAULT_INPUT_UNIT 5
32#define FORTRAN_ERROR_UNIT 0
34#define FORTRAN_RUNTIME_IOSTAT_END (-1)
35#define FORTRAN_RUNTIME_IOSTAT_EOR (-2)
36#define FORTRAN_RUNTIME_IOSTAT_FLUSH (-3)
37#define FORTRAN_RUNTIME_IOSTAT_INQUIRE_INTERNAL_UNIT 256
39#define FORTRAN_RUNTIME_STAT_FAILED_IMAGE 101
40#define FORTRAN_RUNTIME_STAT_LOCKED 102
41#define FORTRAN_RUNTIME_STAT_LOCKED_OTHER_IMAGE 103
42#define FORTRAN_RUNTIME_STAT_STOPPED_IMAGE 104
43#define FORTRAN_RUNTIME_STAT_UNLOCKED 105
44#define FORTRAN_RUNTIME_STAT_UNLOCKED_FAILED_IMAGE 106
47Status codes
for GET_COMMAND_ARGUMENT. The status
for 'value too short' needs
48to be -1, the others must be positive.
50#define FORTRAN_RUNTIME_STAT_INVALID_ARG_NUMBER 107
51#define FORTRAN_RUNTIME_STAT_MISSING_ARG 108
52#define FORTRAN_RUNTIME_STAT_VALUE_TOO_SHORT -1
55Status codes
for GET_ENVIRONMENT_VARIABLE. Values mandated by the standard.
57#define FORTRAN_RUNTIME_STAT_MISSING_ENV_VAR 1
58#define FORTRAN_RUNTIME_STAT_ENV_VARS_UNSUPPORTED 2
61Processor-defined status code
for MOVE_ALLOC where arguments are the
64#define FORTRAN_RUNTIME_STAT_MOVE_ALLOC_SAME_ALLOCATABLE 109
67Additional status code
for a bad pointer DEALLOCATE.
69#define FORTRAN_RUNTIME_STAT_BAD_POINTER_DEALLOCATION 110
72Status codes
for GETCWD.
74#define FORTRAN_RUNTIME_STAT_MISSING_CWD 111
78The sequence is that of F18 Clause 17.2p3, but nothing depends on that.
80#define _FORTRAN_RUNTIME_IEEE_SIGNALING_NAN 1
81#define _FORTRAN_RUNTIME_IEEE_QUIET_NAN 2
82#define _FORTRAN_RUNTIME_IEEE_NEGATIVE_INF 3
83#define _FORTRAN_RUNTIME_IEEE_NEGATIVE_NORMAL 4
84#define _FORTRAN_RUNTIME_IEEE_NEGATIVE_SUBNORMAL 5
85#define _FORTRAN_RUNTIME_IEEE_NEGATIVE_ZERO 6
86#define _FORTRAN_RUNTIME_IEEE_POSITIVE_ZERO 7
87#define _FORTRAN_RUNTIME_IEEE_POSITIVE_SUBNORMAL 8
88#define _FORTRAN_RUNTIME_IEEE_POSITIVE_NORMAL 9
89#define _FORTRAN_RUNTIME_IEEE_POSITIVE_INF 10
90#define _FORTRAN_RUNTIME_IEEE_OTHER_VALUE 11
94The values are those of a common but not universal fenv.h file.
95The denorm value is a nonstandard extension.
97#define _FORTRAN_RUNTIME_IEEE_INVALID 1
98#define _FORTRAN_RUNTIME_IEEE_DENORM 2
99#define _FORTRAN_RUNTIME_IEEE_DIVIDE_BY_ZERO 4
100#define _FORTRAN_RUNTIME_IEEE_OVERFLOW 8
101#define _FORTRAN_RUNTIME_IEEE_UNDERFLOW 16
102#define _FORTRAN_RUNTIME_IEEE_INEXACT 32
103#define _FORTRAN_RUNTIME_IEEE_ALL \
104 _FORTRAN_RUNTIME_IEEE_INVALID | _FORTRAN_RUNTIME_IEEE_DENORM | \
105 _FORTRAN_RUNTIME_IEEE_DIVIDE_BY_ZERO | _FORTRAN_RUNTIME_IEEE_OVERFLOW | \
106 _FORTRAN_RUNTIME_IEEE_UNDERFLOW | _FORTRAN_RUNTIME_IEEE_INEXACT
109ieee_round_type values
110The values are those of the llvm.get.rounding intrinsic, which is assumed by
111ieee_arithmetic module rounding procedures.
113#define _FORTRAN_RUNTIME_IEEE_TO_ZERO 0
114#define _FORTRAN_RUNTIME_IEEE_NEAREST 1
115#define _FORTRAN_RUNTIME_IEEE_UP 2
116#define _FORTRAN_RUNTIME_IEEE_DOWN 3
117#define _FORTRAN_RUNTIME_IEEE_AWAY 4
118#define _FORTRAN_RUNTIME_IEEE_OTHER 5
121INTEGER(kind=4) extents for ieee_exceptions module types ieee_modes_type and
122ieee_status_type. These extent values are large enough to hold femode_t and
123fenv_t data in many environments. An environment that does not meet these
124size constraints may allocate memory with runtime size values.
126#define _FORTRAN_RUNTIME_IEEE_FEMODE_T_EXTENT 2
127#define _FORTRAN_RUNTIME_IEEE_FENV_T_EXTENT 8
Definition: bit-population-count.h:20