- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm porting an old Fortran 77 program that has a type mismatch by design. It's an FFT routine that can take a real or complex argument - bad practice, but it worked.
The curious thing is that the subroutine compiles quietly in Release but throws an error in Debug.
Is there a bug?
The curious thing is that the subroutine compiles quietly in Release but throws an error in Debug.
Is there a bug?
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In addition to Jugoslav's suggestion about turning the warning message off look in the documentation relating to generic interface and the use of attribute ALIAS. Using generic interface you can declare a single named subroutine that takes different argument lists with the intended effect of dispatching to two different subroutines, but the use of ALIAS can be used here to specify that both of the dispatch subroutines are the same third subroutine (no code generated for the two interviening subroutines.
Let's say you have a subroutine FOO that you call with real arg RARRAY for complex CARRAY. Using generic interface you can specify an interface for FOO that when called with RARRAY will call FOOR and when FOO is called with CARRAY the generic interface calls FOOC. However adding alias, you can specify that FOOR is FOORC and specify FOOC also FOORC.
Although this may seem like a lot of work to avoid what you might view as and unnecessary warning the technique also provides you with the ability to divide the joined routines into two seperate routines or one routine with seperate entry points.
Jim Dempsey
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - scrognoid
I'm porting an old Fortran 77 program that has a type mismatch by design. It's an FFT routine that can take a real or complex argument - bad practice, but it worked.
The curious thing is that the subroutine compiles quietly in Release but throws an error in Debug.
Is there a bug?
The curious thing is that the subroutine compiles quietly in Release but throws an error in Debug.
Is there a bug?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - scrognoid
The curious thing is that the subroutine compiles quietly in Release but throws an error in Debug.
Because /gen-interfaces and /warn:interfaces options are by default on in Debug configuration. You can switch them off (check the docs where to find them in the Project Properties dialog).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In addition to Jugoslav's suggestion about turning the warning message off look in the documentation relating to generic interface and the use of attribute ALIAS. Using generic interface you can declare a single named subroutine that takes different argument lists with the intended effect of dispatching to two different subroutines, but the use of ALIAS can be used here to specify that both of the dispatch subroutines are the same third subroutine (no code generated for the two interviening subroutines.
Let's say you have a subroutine FOO that you call with real arg RARRAY for complex CARRAY. Using generic interface you can specify an interface for FOO that when called with RARRAY will call FOOR and when FOO is called with CARRAY the generic interface calls FOOC. However adding alias, you can specify that FOOR is FOORC and specify FOOC also FOORC.
Although this may seem like a lot of work to avoid what you might view as and unnecessary warning the technique also provides you with the ability to divide the joined routines into two seperate routines or one routine with seperate entry points.
Jim Dempsey

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