- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following code:
pointer (iaa,a(1))
call free(iaa)
iaa = malloc(4*2*8066907)
do ii = 1, 7566907
a(ii) = 0
enddo
works fine as a part of a Fortran exe program but it
generates an error as part of a Fortran DLL
for a(ii) = 0 when ii=2
Unhandled exception in Prog1.exe (TESTSUB.DLL):
0xC000008C: Array Bounds Exceeded.
What I can do to run this piece of code inside a Fortran DLL
file without any errors?
TIA,
Izydor
pointer (iaa,a(1))
call free(iaa)
iaa = malloc(4*2*8066907)
do ii = 1, 7566907
a(ii) = 0
enddo
works fine as a part of a Fortran exe program but it
generates an error as part of a Fortran DLL
for a(ii) = 0 when ii=2
Unhandled exception in Prog1.exe (TESTSUB.DLL):
0xC000008C: Array Bounds Exceeded.
What I can do to run this piece of code inside a Fortran DLL
file without any errors?
TIA,
Izydor
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Change a(1) to a(*)
Incidentally, you'd get the same error in an executable program if compiled with bounds checking enabled.
Steve
Incidentally, you'd get the same error in an executable program if compiled with bounds checking enabled.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Isn't it bad form to call free before malloc?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Indeed it is!
Steve
Steve

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