- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Under f03, assignment to an allocatable array will change the size of the allocatable array to conform to the target. This, of course, completely and utterly defeats any hope of the compiler, much less the debugger, detecting an array conformance mismatch. With the results that the actual error message (should the programmer be so fortunate as to receive one) will be some distance from where the actual problem occured. [ref: The New Features of Fortran 2003" by John Reid, section 3.3]
Of course one can program defensively, but I would prefer that it were possible to direct the compiler not to do this sort of thing in the first place. That is, I would breath easier if their were a way, short of specifying "f90 -stand=f95" to disallow such promiscuous realignment of allocatable arrays.
Of course one can program defensively, but I would prefer that it were possible to direct the compiler not to do this sort of thing in the first place. That is, I would breath easier if their were a way, short of specifying "f90 -stand=f95" to disallow such promiscuous realignment of allocatable arrays.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We hear you. Actually, the 10.0 compiler doesn't do that automatic reallocation, but a future version will. In that version, the automatic reallocation is NOT the default, but you can ask for it using a new command line option. The automatic reallocation would slow down ordinary code that didn't need it, and perhaps one day we'll implement shape checking which can be an added help.
I'll also note that -stand is intended to produce diagnostic messages only and not to change any behavior.
I'll also note that -stand is intended to produce diagnostic messages only and not to change any behavior.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
whew!
Thanks
Thanks

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page