Lokesh,
After a brief discussion on the J3 list, I believe the answer is that
> So, there is an ambiguity to predict output in such cases.
there is no ambiguity---default initialization is allowed with BIND(C).
> What should be the output in above case at "Initialization of derived
> type from fortan"?
It should be
> 10
> 20
In section 15.3 you will read:
"A variable shall not be initially defined by more than one processor."
(here processor means Fortran and C, not hardware processors...Fortran
is still a serial language :-)
Your example satisfies this condition. The semantics is clear--obj is
initially defined with the default initial values (our standard says so
in chapter 16). And it seems like there is no problem with
implementations (at least two worked as expected :-).
If you have some other troubling example, please send it to me.
Thanks,
Aleks
|