- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Shouldn't /check:bounds catch these errors? I know these are stupid mistakes, but I tend to make stupid mistakes ![smiley [:-)]](/isn/Community/en-US/emoticons/emotion-1.gif)
program bounds
implicit none
double precision, allocatable :: A(:,:), B(:,:), C(:,:)
allocate( A(2,2), B(2,3), C(3,3) )
B = 1; C = 2
A = matmul( B, C )
print *, 'A = B*C passed'
A = matmul( C, B )
print *, 'A = C*B passed'
A = C
print *, 'A = C passed'
end program bounds
![smiley [:-)]](/isn/Community/en-US/emoticons/emotion-1.gif)
program bounds
implicit none
double precision, allocatable :: A(:,:), B(:,:), C(:,:)
allocate( A(2,2), B(2,3), C(3,3) )
B = 1; C = 2
A = matmul( B, C )
print *, 'A = B*C passed'
A = matmul( C, B )
print *, 'A = C*B passed'
A = C
print *, 'A = C passed'
end program bounds
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not necessarily - these are shape mismatch errors which the compiler does not detect at runtime. Bounds checking will look at explicit use of subscripts.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Forgot to say which compiler version I am using. It is
Intel Fortran Compiler 10.1.014 [IA-32]
Intel Fortran Compiler 10.1.014 [IA-32]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK. Is there a compiler option that does check for this? Seems like it would be a (relatively) easy thing to do.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No - it's on our wish list, though.

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