https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122957
Steve Kargl <kargl at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kargl at gcc dot gnu.org
--- Comment #2 from Steve Kargl <kargl at gcc dot gnu.org> ---
(In reply to Jerry DeLisle from comment #1)
> This is a known issue. It is highly recommended that you do not use
> -fdefault-integer-8 for anything as it is not standard conforming and
> definitely not portable. There have been more than one discussion about
> deleting this feature because it is so problematic.
>
> It is recommended that you define a working precision parameter in your
> codes that is defined in one place and use that parameter to define the KIND
> in your declarations so that you can change it reliably.
>
> As soon as I find time I will mark this bug report as a duplicate of the
> last one we had about this.
Might as well hit with a hammer. May need add a check for
gfc_default_integer_kind = 8 in the if-statements.
diff --git a/gcc/fortran/interface.cc b/gcc/fortran/interface.cc
index ef5a17d0af4..6ed01e2cee9 100644
--- a/gcc/fortran/interface.cc
+++ b/gcc/fortran/interface.cc
@@ -211,11 +211,15 @@ gfc_match_generic_spec (interface_type *type,
*op = dtio_op (buffer);
if (*op == INTRINSIC_FORMATTED)
{
+ if (flag_default_integer)
+ goto conflict;
strcpy (name, gfc_code2string (dtio_procs, DTIO_RF));
*type = INTERFACE_DTIO;
}
if (*op == INTRINSIC_UNFORMATTED)
{
+ if (flag_default_integer)
+ goto conflict;
strcpy (name, gfc_code2string (dtio_procs, DTIO_RUF));
*type = INTERFACE_DTIO;
}
@@ -228,11 +232,15 @@ gfc_match_generic_spec (interface_type *type,
*op = dtio_op (buffer);
if (*op == INTRINSIC_FORMATTED)
{
+ if (flag_default_integer)
+ goto conflict;
strcpy (name, gfc_code2string (dtio_procs, DTIO_WF));
*type = INTERFACE_DTIO;
}
if (*op == INTRINSIC_UNFORMATTED)
{
+ if (flag_default_integer)
+ goto conflict;
strcpy (name, gfc_code2string (dtio_procs, DTIO_WUF));
*type = INTERFACE_DTIO;
}
@@ -250,6 +258,11 @@ gfc_match_generic_spec (interface_type *type,
*type = INTERFACE_NAMELESS;
return MATCH_YES;
+conflict:
+ gfc_error ("-fdefault-integer-8 option conflicts with user-defined "
+ "input/output at %C");
+ return MATCH_ERROR;
+
syntax:
gfc_error ("Syntax error in generic specification at %C");
return MATCH_ERROR;