.mod file compatibility
W Spector
w6ws@earthlink.net
Sat Sep 7 17:59:00 GMT 2013
On 09/06/2013 09:56 PM, Tobias Burnus wrote:
> W Spector wrote:
>> In the potential v4.10 case, where you are looking at changing the
>> array descriptors, it seems like the compiler could pass either an old
>> descriptor or a new descriptor - based on whether an old .mod or a new
>> .mod describes the callee. Just an idea. However I can easily think
>> of situations where supporting multiple .mod levels simultaneously
>> could potentially get out of hand.
>
> But that will lead to hard to track problems if you use in one file:
>
> interface
> subroutine foo(x)
> real :: x(:)
> end subroutine foo
> end interface
>
> When should one call "foo" with the new or the old array descriptor? If
> "foo" is in a library, it might either use the new or the old
> descriptor.
In a case like the above, I would expect that the "foo" implementation
was separately compiled with the *same* compiler version as its
corresponding interface, and therefore .mod file was. Thus you would
know how to pass descriptors.
However there certainly are other cases where it would be hard to
determine what to do. In those cases, some sort of compiler error at a
call, procedure pointer assignment, etc would be the correct thing to do.
That will lead too very hard to track run-time issues.
> Besides, the descriptor really affects large parts of the both
> libgfortran and the compiler. It is not just about adding a new field or
> something like that. The biggest change is the replacement of an
> element-based stride by a byte-based stride-multiplier. And the
> replacement of "upper_bound" by "extent", but that's less of a problem.
> Those require large changes in the compiler and quite some changes in
> the library - that's the reason that implementing it takes that long. I
> don't want to simultaneously maintain another descriptor.
As I said, I completely understand the issue. Maybe after 4.10, there
could be some better adherence to reading old .mod files? Apparently
the next Fortran Standard is going to have very little in the way of new
features. So one would hope the descriptors and other module
information would remain fairly stable for a while.
Walter
More information about the Fortran
mailing list