For the OP's problem, not much, as he is using g77, which is f77 rather
thn f2003. And he is even using a nonstandard feature of g77, making
what aany version of the standard says of questionable relevance.
> I wonder about why C583 was introduced, as most of my past use of
> EQUIVALENCE was associated with COMMON and did involve mixed type.
The past and the future are different, and in this case intentionally
so. That constraint specifically excepts the cases that were valid in
f77, and it does so to keep from invalidating previously valid f77 code.
However, there are 2 reasons for disallowing such type mixing for cases
that were not covered by f77.
1. I grant this one is my personal perception rather than something
concretely provable by reference to the standard, but... I think there
was a perception that using common and equivalence for type punning like
this is a practice to be discouraged and phased out. Heck, there was at
least some feeling that all use of COMMON and EQUIVALENCE be declared
obsolescent. That notion failed to be adopted into the final standard,
but there were folk in favor of it. There remained, however, a bit of
sentiment against enhancing common and equivalence, particularly the
aspects that are not considered good practice by current thinking.
(Well, that would have been "current" of about 30 years ago when that
constraint was added, but I don't think feelings have changed much since
then.)
2. Much more concretely, to allow type punning of that sort in other
types would imply specifying the storage sizes of those other types.
That definitely was something the standard was moving away from.
That's basically the same reason that character and non-character data
was not allowed in the same common in f77. To do so would have implied
that the relative storage size of character and numeric types was fixed.
Note that the standard doesn't say that compilers can't do things like
allow all sorts of type punning via common. It just says that such type
punning (other than the cases allowed in f77) are nonstandard and thus
non-portable between compilers. Hmm. I'm not sure I'm explaining that
point well, but the standard is about things that you can expect to work
the same way on all standard conforming compilers. If expected
implementations of something are going to have different results on
different compilers, then that gets labelled as nonstandard. That
doesn't mean compilers aren't allowed to compile it (though in this
case, being a constraint, compilers are required to be able to detect
and at least warn about it), but it puts users on notice that it might
not get the same results on all systems (and might not even compile at
all on some).
--
Richard Maine
email: last name at domain . net
dimnain: summer-triangle