* trans-types.c (gfc_max_integer_kind): Declare
(gfc_init_kinds): Initialize it.
* gfortran.h (gfc_max_integer_kind): extern it.
* primary.c (match_boz_constant): Use it; remove gfortran extension
of kind suffixes on BOZ literal constants
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95643
138bc75d-0d04-0410-961f-
82ee72b054a4
+2005-02-27 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/20058
+ * trans-types.c (gfc_max_integer_kind): Declare
+ (gfc_init_kinds): Initialize it.
+ * gfortran.h (gfc_max_integer_kind): extern it.
+ * primary.c (match_boz_constant): Use it; remove gfortran extension
+ of kind suffixes on BOZ literal constants
+
+
2005-02-27 Steven G. Kargl <kargls@comcast.net>
* arith.c (gfc_check_real_range): Remove multiple returns
int gfc_validate_kind (bt, int, bool);
extern int gfc_index_integer_kind;
extern int gfc_default_integer_kind;
+extern int gfc_max_integer_kind;
extern int gfc_default_real_kind;
extern int gfc_default_double_kind;
extern int gfc_default_character_kind;
match_digits (0, radix, buffer);
gfc_next_char (); /* Eat delimiter. */
- kind = get_kind ();
- if (kind == -1)
- return MATCH_ERROR;
- if (kind == -2)
- kind = gfc_default_integer_kind;
- else if (pedantic
- && (gfc_notify_std (GFC_STD_GNU, "Extension: Kind parameter "
- "suffix to boz literal constant at %C.")
- == FAILURE))
- return MATCH_ERROR;
+ /* In section 5.2.5 and following C567 in the Fortran 2003 standard, we find
+ "If a data-stmt-constant is a boz-literal-constant, the corresponding
+ variable shall be of type integer. The boz-literal-constant is treated
+ as if it were an int-literal-constant with a kind-param that specifies
+ the representation method with the largest decimal exponent range
+ supported by the processor." */
+
+ kind = gfc_max_integer_kind;
e = gfc_convert_integer (buffer, kind, radix, &gfc_current_locus);
if (gfc_range_check (e) != ARITH_OK)
/* The default kinds of the various types. */
int gfc_default_integer_kind;
+int gfc_max_integer_kind;
int gfc_default_real_kind;
int gfc_default_double_kind;
int gfc_default_character_kind;
i_index += 1;
}
+ /* Set the maximum integer kind. Used with at least BOZ constants. */
+ gfc_max_integer_kind = gfc_integer_kinds[i_index - 1].kind;
+
for (r_index = 0, mode = MIN_MODE_FLOAT; mode <= MAX_MODE_FLOAT; mode++)
{
const struct real_format *fmt = REAL_MODE_FORMAT (mode);