|
|
3db796 |
From d75972937274489189a151a47da9b9aadfdefe8d Mon Sep 17 00:00:00 2001
|
|
|
3db796 |
From: Jim MacArthur <jim.macarthur@codethink.co.uk>
|
|
|
3db796 |
Date: Mon, 5 Oct 2015 13:45:15 +0100
|
|
|
3db796 |
Subject: [PATCH 07/23] Allow more than one character as argument to ICHAR
|
|
|
3db796 |
|
|
|
3db796 |
This feature is enabled by the `-std=extra-legacy` compiler flag.
|
|
|
3db796 |
---
|
|
|
3db796 |
|
|
|
3db796 |
0007-Allow-more-than-one-character-as-argument-to-ICHAR.patch
|
|
|
3db796 |
|
|
|
3db796 |
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
|
|
|
3db796 |
index fd0d280..b84022b 100644
|
|
|
3db796 |
--- a/gcc/fortran/check.c
|
|
|
3db796 |
+++ b/gcc/fortran/check.c
|
|
|
3db796 |
@@ -2493,7 +2493,7 @@ gfc_check_ichar_iachar (gfc_expr *c, gfc_expr *kind)
|
|
|
3db796 |
else
|
|
|
3db796 |
return true;
|
|
|
3db796 |
|
|
|
3db796 |
- if (i != 1)
|
|
|
3db796 |
+ if (i != 1 && !(gfc_option.allow_std & GFC_STD_EXTRA_LEGACY))
|
|
|
3db796 |
{
|
|
|
3db796 |
gfc_error ("Argument of %s at %L must be of length one",
|
|
|
3db796 |
gfc_current_intrinsic, &c->where);
|
|
|
3db796 |
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
|
|
|
3db796 |
index d64f2f3..fce03df 100644
|
|
|
3db796 |
--- a/gcc/fortran/simplify.c
|
|
|
3db796 |
+++ b/gcc/fortran/simplify.c
|
|
|
3db796 |
@@ -2774,7 +2774,7 @@ gfc_simplify_iachar (gfc_expr *e, gfc_expr *kind)
|
|
|
3db796 |
if (e->expr_type != EXPR_CONSTANT)
|
|
|
3db796 |
return NULL;
|
|
|
3db796 |
|
|
|
3db796 |
- if (e->value.character.length != 1)
|
|
|
3db796 |
+ if (e->value.character.length != 1 && !(gfc_option.allow_std & GFC_STD_EXTRA_LEGACY))
|
|
|
3db796 |
{
|
|
|
3db796 |
gfc_error ("Argument of IACHAR at %L must be of length one", &e->where);
|
|
|
3db796 |
return &gfc_bad_expr;
|
|
|
3db796 |
@@ -2972,7 +2972,7 @@ gfc_simplify_ichar (gfc_expr *e, gfc_expr *kind)
|
|
|
3db796 |
if (e->expr_type != EXPR_CONSTANT)
|
|
|
3db796 |
return NULL;
|
|
|
3db796 |
|
|
|
3db796 |
- if (e->value.character.length != 1)
|
|
|
3db796 |
+ if (e->value.character.length != 1 && !(gfc_option.allow_std & GFC_STD_EXTRA_LEGACY))
|
|
|
3db796 |
{
|
|
|
3db796 |
gfc_error ("Argument of ICHAR at %L must be of length one", &e->where);
|
|
|
3db796 |
return &gfc_bad_expr;
|