- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
The automatic reallocation of array feature is not turned on by default of compiler 16.0. Now I'm using 19.0 and the automatic reallocation is giving me trouble. How do I turn it off?
링크가 복사됨
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
-[no]standard-realloc-lhs
explicitly sets assume keyword realloc_lhs to conform to the
standard, or to override the default. Sets -assume [no]realloc_lhs
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
What kind of trouble is it causing? Having it enabled (thus conforming to the standard) should have no effect on a correct program.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
For compiler 16.0, when I allocate an array of size 1 and set it equal to an array of size larger than one, it will just grab the first element. Now in 19.0, it will tell me error saying array size don't match.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
So you should be glad that the more modern compiler is detecting your programming error.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
if you just want to hack the code for a one-time project, understandable. If that is a code you want to maintain for the upcoming years, it is for sure worth to refactor it and write it as valid Fortran.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
You can't guarantee that it will use the size of one side of assignment or the other, if you turn off automatic reallocation. Maybe it works the way you want it now, but a compiler change might cause it to use the size of the larger array. Indeed it may already be doing that and you haven't noticed yet.
Your code is fundamentally broken. Please fix it before you encounter problems.
