- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I read round the help files which do not say very much and had a some (hopefully) quick question.
1] Is the sample below valid usage of the directive?
2] Having use FORCEINLINE in a subroutine that is called from multiple locations I expected to see an increase in my .exe size but there is no change. Is my expection wrong?
3] would some build option cause FORCEINLINE to be ignored?
4] Any other comments or suggestions, the object was to make hacking/code patching more difficult
subroutine myfunc( istat, kbuf1)
!DEC$ATTRIBUTES FORCEINLINE :: myfunc
use mymod
integer(4) :: istat
integer(1) :: kbuf1(1)
!code
!code
!code
return
end
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you building with the /Qipo option? If not, then FORCEINLINE would not have an effect if the call was in a different source file.
Please put a space between !DEC$ and ATTRIBUTES. The compiler will accept leaving the space out, but it is not correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If forceinline takes effect when compiling with a single compile command (as opposed to ipo), it should be reflected in opt-report as well as in asm and object code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am not using /Qipo option I will investigate that. As for the !DEC$ it seems I have been wrong for years, a bad trait from some example files.... A global edit has fixed that :-)
Thanks for the info Steve /TimP that explains my findings.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page