- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following test code reflects a problem observed in debug regarding functions.
PROBLEM: FUNCTIONs with ENTRY points are crashing under debug
COMPILER FLAGS:
/nologo /Zi /Od /module:"$(INTDIR)/" /object:"$(INTDIR)/" /traceback /libs:static /threads /dbglibs /c
VERSION OF FORTRAN:
Intel 9.1
DEVELOPMENT ENVIRONMENT:
Visual Studio 2005
FREQUENCY: happens every time in debug; never in release. It does not happen if "func" does not have an ENTRY statement in it.
TEST CODE:
!***************************************************************
!
! PROGRAM: TestError
!
! PURPOSE: Test problem with function entries under debug.
!
!***************************************************************
program TestError
real x, func_entry, func
! *** test functions
x=func(1.,2.)
x=func_entry
print*, 'x= ', x
end program TestError
! *********************************
real function func( x, y )
real x, y
func = 0.0
return
entry func_entry
func=1.0
return
end
Link Copied
9 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think you want:
x=func_entry()
instead.
x=func_entry()
instead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think the code in the ENTRY should be
entry func_entry
func_entry=1.0
return
Greetings, Wolf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Either func or func_entry can be assigned. The language states that these two are effectively EQUIVALENCEd.
The lack of the parentheses on the "call" to func_entry is the real problem. This changes the statement to an assignment of an uninitialized variable called func_entry instead of a function call.
The lack of the parentheses on the "call" to func_entry is the real problem. This changes the statement to an assignment of an uninitialized variable called func_entry instead of a function call.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Even with the parenthesis, we get the crash (debug only) given the compiler options specified. Does this run for other folks?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Runs fine for me in the debugger and gives the correct answer. What sort of "crash" do you get?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried both of their suggestions:
x=func_entry()
and
func_entry=1.0
Here is the runtime error under debug:
forrtl: severe (193): Run-Time Check Failure. The variable 'FUNC$FUNC' is being
used without being defined
Image PC Routine Line Source
testerror.exe 00492232 Unknown Unknown Unknown
testerror.exe 0048F4C4 Unknown Unknown Unknown
testerror.exe 00405412 Unknown Unknown Unknown
testerror.exe 0040563A Unknown Unknown Unknown
testerror.exe 00401162 _FUNC 28 TestError.f90
testerror.exe 00401034 _MAIN__ 12 TestError.f90
testerror.exe 00498980 Unknown Unknown Unknown
testerror.exe 0043BBE3 Unknown Unknown Unknown
testerror.exe 0043B9AD Unknown Unknown Unknown
kernel32.dll 7C816D4F Unknown Unknown Unknown
used without being defined
Image PC Routine Line Source
testerror.exe 00492232 Unknown Unknown Unknown
testerror.exe 0048F4C4 Unknown Unknown Unknown
testerror.exe 00405412 Unknown Unknown Unknown
testerror.exe 0040563A Unknown Unknown Unknown
testerror.exe 00401162 _FUNC 28 TestError.f90
testerror.exe 00401034 _MAIN__ 12 TestError.f90
testerror.exe 00498980 Unknown Unknown Unknown
testerror.exe 0043BBE3 Unknown Unknown Unknown
testerror.exe 0043B9AD Unknown Unknown Unknown
kernel32.dll 7C816D4F Unknown Unknown Unknown
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oh, you are using the optional uninitialized variable checking and are getting a run-time error for that. Not quite what I would consider "crashed".
Anyway, I don't see this behavior with the just-released 9.1.025. Please try that.
Anyway, I don't see this behavior with the just-released 9.1.025. Please try that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, the update to the latest compiler (9.1.025) did the trick and got rid of our runtime error. Thanks!
Message Edited by MattIntelNETFort on 06-06-200611:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Glad to hear it.
Please remember that this is a user forum and not meant as a channel for submitting support requests to Intel. Please use Intel Premier Support for that.
Please remember that this is a user forum and not meant as a channel for submitting support requests to Intel. Please use Intel Premier Support for that.

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