[Bug fortran/66725] Issue with silent conversion int to char, ICE if int too large
kargl at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jul 2 21:40:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66725
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P4
Status|UNCONFIRMED |NEW
Last reconfirmed| |2015-07-02
CC| |kargl at gcc dot gnu.org
Assignee|unassigned at gcc dot gnu.org |kargl at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #3 from kargl at gcc dot gnu.org ---
It seems that a type check is missing for STATUS=some_entity.
With this diff (watch cut-n-paste tab corruption),
Index: io.c
===================================================================
--- io.c (revision 225348)
+++ io.c (working copy)
@@ -2071,6 +2071,12 @@ gfc_match_open (void)
static const char *status[] = { "OLD", "NEW", "SCRATCH",
"REPLACE", "UNKNOWN", NULL };
+ if (open->status->ts.type != BT_CHARACTER)
+ {
+ gfc_error("scalar-default-char-expr required at %C");
+ goto cleanup;
+ }
+
if (!compare_to_allowed_values ("STATUS", status, NULL, NULL,
open->status->value.character.string,
"OPEN", warn))
I get
% gfc6 -o z aa.f90
aa.f90:2:23:
open (1, status=257)
1
Error: scalar-default-char-expr required at (1)
I suspect the other TAGS need a similar check.
More information about the Gcc-bugs
mailing list