blamm
04-27-2004, 01:30 PM
I'm a registered Lahey user, currently at LF Fortran 7.1, but have a problem that I consider a bug and Lahey does not.
I want to know your opinion, especially those of Terrence Wright and Richard Russell.
Suppose a program is built, using any compiler switches you like, resulting in an executable with an assignment thus:
a(7:12) = c(7:12)
where a array is declared as real, dimension(12) and c array is declared as real, dimension(6).
Now, regardless of the Lahey switches used to build the executable, there would be a runtime error on the subscript bounds of c array in the above assignment.
Now suppose the following assignment is made:
a(7:12) = b%c(7:12)
where a array is real, dimension(12), b is a scalar derived type with an ALLOCATABLE component c which is allocated as ALLOCATE( b%c(1:6) ).
If you compile with ANY switches you like ( as long as of course the executable successfully builds), then in my opinion the above assignment should cause a runtime error due to referencing out-of-bounds subscript on allocatable component c.
However, the latter assignment SUCCEEDS, an assignment is made and the program continues on its merry way executing with GARBAGE in a(7:12)
Lahey insists this is not a bug, but rather a product suggestion. Lahey received the "product suggestion" in 1999.
In my opinion, this is NOT a DEBUG issue, I believe it is an issue of CORRECT IMPLEMENTATION of allocatable components of derived types.
Lahey's utterly lame suggestion was to make the allocatble component c NOT allocatable, but rather a component of fixed dimension, which completely obviates the usefulness of allocatable components to begin with!
What's your opinion? Should the latter assignment be permitted to "quietly" succeed?
Brian E. Lamm
I want to know your opinion, especially those of Terrence Wright and Richard Russell.
Suppose a program is built, using any compiler switches you like, resulting in an executable with an assignment thus:
a(7:12) = c(7:12)
where a array is declared as real, dimension(12) and c array is declared as real, dimension(6).
Now, regardless of the Lahey switches used to build the executable, there would be a runtime error on the subscript bounds of c array in the above assignment.
Now suppose the following assignment is made:
a(7:12) = b%c(7:12)
where a array is real, dimension(12), b is a scalar derived type with an ALLOCATABLE component c which is allocated as ALLOCATE( b%c(1:6) ).
If you compile with ANY switches you like ( as long as of course the executable successfully builds), then in my opinion the above assignment should cause a runtime error due to referencing out-of-bounds subscript on allocatable component c.
However, the latter assignment SUCCEEDS, an assignment is made and the program continues on its merry way executing with GARBAGE in a(7:12)
Lahey insists this is not a bug, but rather a product suggestion. Lahey received the "product suggestion" in 1999.
In my opinion, this is NOT a DEBUG issue, I believe it is an issue of CORRECT IMPLEMENTATION of allocatable components of derived types.
Lahey's utterly lame suggestion was to make the allocatble component c NOT allocatable, but rather a component of fixed dimension, which completely obviates the usefulness of allocatable components to begin with!
What's your opinion? Should the latter assignment be permitted to "quietly" succeed?
Brian E. Lamm