Richard Maine wrote:
> Make sure it happend only for type-bound defined assignments. Otherwise
> you will break valid f90/f95 code. See my other reply.
I think the patch handles this correctly, but I will re-check.
Richard Maine wrote:
>> generic :: assignment(=) => a_ass
>> > 1
>> >Error: 'a_ass' and 'a_ass_sv' for GENERIC '=' at (1) are ambiguous
> ...
>> >I don't see why these two are ambiguous: I thought array argument
>> >procedures were supposed to override elemental procedures.
> I believe you are correct,
So do I - and looking at the patch its a bug related to the CLASS
implementation and not to array vs. scalar checking. The issue has been
filled as problem report, which already has a patch. Cf.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54594
Richard Maine wrote:
> Note that, as I alluded to previously, neither of the compilers you
> mention (or any other that you are likely to be able to use) claims to
> be an f2003 compiler. So no, even ignoring matters of possible compiler
> bugs, it is not valid to deduce the specifications of f2003 based on
> compilers that don't claim to conform to it.
Well, but that also doesn't work with those compiles which claim full
Fortran 2003 conformance; vendors might miss smaller features. For
instance, I had a code which contained as only Fortran 2003 feature:
REAL, PARAMETER :: maxexp = LOG(2.0)*MAXEXPONENT(2.0)
The code was compiling with 5 of my compilers - but not with the only
one which claimed full Fortran 2003 conformance.
Thus, I think using newer compilers gives a hint whether something is
standard conforming or not, but only the standard provides a definite
answer. (On the other hand, it also doesn't help if something is
standard conforming but not supported by the compilers one uses.)
Paweł Biernat wrote:
> Referring to your comment on unimplemented features of f2003, this
> might be a delicate question, but what is the reason of such state? Is
> it due to the complexity of the standard (almost 600 pp for f2003) or
> are there other priorities like improving performance of existing
> features? I am a complete ignorant in the matter of feature
> implementation and I don't intend to judge compiler programmers but
> asking out of pure curiosity.
Fortran 2003 added quite a lot of new features thus it simply takes time
to implement it. And especially smaller features might be missed, e.g.
supporting arrays of nonconstant size in namelists. Additionally, other
things like performance, diagnostic support, fixing bugs also take time
to develop. As do other features like OpenMP, highly-demanded Fortran
2008 features, etc.
My impression was also that the pressure on vendors to implement Fortran
2003 features was relatively low until the later mid-2000s. However, I
think currently there is quite some pressure on vendors to implement at
least the more common Fortran 2003 features.
In case of gfortran: g95/gfortran were create relatively recently. And
in the first version of gfortran (GCC 4.0/4.1, ~2005) the focus was on
fully supporting Fortran 95 and fixing the bugs. Only when the Fortran
95 was stable, the implementation of newer features could start.
Especially as gfortran is nearly entirely developed as voluntary,
spare-time project, the development is not as linear as with commercial
compilers.
However, the Fortran 2003 supports gets more and more complete and solid
in all major compilers, including gfortran. I also think that it will
taker shorter until Fortran 2008 is supported, not only because the
additions were smaller but also because of the current momentum.
For GCC 4.8 you can expect support for CLASS(*) and FINAL subroutines
[both features are nearly ready] - and many smaller improvements which
aren't visible in the release notes; e.g. a fix for the bug which
started this thread. Besides minor issues, the only other missing big
Fortran 2003 features are parameterized-derived types, user-defined I/O
and the (optional!) IEEE support.
On the other hand, some features of newer standards will also be
implemented earlier; for instance, in GCC 4.8 there is support for
assumed-type TYPE(*) and (incomplete support for) assumed-rank
DIMENSION(..) of Technical Specification (TS) 29113:2012. One could
argue that Fortran 2003 should have been first completed. However,
TYPE(*),DIMENSION(..) is required by an important library: The Message
Passing Interface (MPI) 3.0 will use it.* Additionally, the FINAL
subroutine support uses assumed-rank internally.
(The trigger for the TYPE(*) and then DIMENSION(..) support was that
gfortran seems to be the only compiler which doesn't seem to have a
vendor-specific directive to ignore the TKI check for an argument, which
is what MPI vendors like to use for their buffer argument. The hope was
that TYPE(*) is sufficient, but passing a scalar to TYPE(*),DIMENSION(*)
is not allowed; thus, dimension(..) is needed. Assumed-rank arrays also
allow the MPI library to handle arrays with strides internally, which is
another bonus.)
Tobias
* See
http://meetings.mpi-forum.org/MPI_3.0_main_page.php; there is also
some preliminary support for F2008+TS in Open MPI.