http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48303
--- Comment #3 from Steven Bosscher <steven at gcc dot gnu.org> 2011-03-27
23:08:20 UTC ---
Interpret them as Hollerith constants? Something like this extremely crude code
from the hip:
/* Only DATA Statements come here. */
if (!conform)
{
/* Numeric can be converted to any other numeric. And Hollerith can be
converted to any other type. */
if ((gfc_numeric_ts (&lvalue->ts) && gfc_numeric_ts (&rvalue->ts))
|| rvalue->ts.type == BT_HOLLERITH)
return SUCCESS;
if (lvalue->ts.type == BT_LOGICAL && rvalue->ts.type == BT_LOGICAL)
return SUCCESS;
/* In legacy mode, accept CHARACTER data, interpreted as a Hollerith
constant. */
if (lvalue->ts.type != rvalue->ts.type
&& rvalue->ts.type == BT_CHARACTER
&& rvalue->ts.kind == gfc_default_character_kind)
{
gfc_expr *e;
unsigned i, l;
if (gfc_notify_std (GFC_STD_LEGACY, "Shame on you at %C ")
== FAILURE)
return FAILURE;
l = rvalue->value.character.length;
e = gfc_get_constant_expr (BT_HOLLERITH, gfc_default_character_kind,
&rvalue->where);
e->representation.string = XCNEWVEC (char, l + 1);
for (i = 0; i < l; i++)
{
gfc_char_t c = rvalue->value.character.string[i];
e->representation.string[i] = (char) c;
}
*rvalue = *e; /* ??? Not sure how to replace rvalue with the new e */
return SUCCESS;
}