Lokesh Chugh, Noida wrote:
> "A derived type with the BIND attribute shall not have components with
> default initialization."
It seems there isn't in the published standard.
> I am asking this query, as C standard does not support a feature that is
> equivalent to default initialization for derived types in FORTRAN.
Yes, but this is not a necessary criterion for interoperability---C does
not have optional arguments yet recently we added them to Interop for
the next revision. I would say a relevant criterion is whether there is
an actual problem with having default initialization? Certainly it is
useful if the bulk of codes is written in Fortran---why not use the
feature. It does not change the physical representation of the type and
C can use the values regardless of whether they were (partially)
produced by default initialization.
In Fortran, a major semantical guideline is that a thingo of derived
type with default initialization cannot (ever!) end up undefined---that
is, instead of becoming undefined (as it would if the type did not have
default initialization), it is default (re)initialized. So this is where
I can see a possible problem occuring, but I have not thought enough
about it. Do you see an actual problem (implementation or semantics wise)?
Thanks,
Aleks
|