- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The /warn:unused option does not catch many instances of unused variables in Ifort 16.0, and many checks are inhibited by the presence of contained routines of no relevance to catching unused variables.
Here is an example.
subroutine xyz(i,j,k) integer p,q,r p=2 q=p*2 return !contains !subroutine klm !end subroutine end
Compiling with /Od /warn:unused gives:
xyz.f90(1): remark #7712: This variable has not been used. subroutine xyz(i,j,k) ---------------^ xyz.f90(1): remark #7712: This variable has not been used.subroutine xyz(i,j,k) -----------------^ xyz.f90(1): remark #7712: This variable has not been used. subroutine xyz(i,j,k) -------------------^ xyz.f90(2): remark #7712: This variable has not been used. integer p,q,r ------------^
If the three comment marks are removed from lines 7,8 and 9, the output text from the compiler is reduced to:
xyz.f90(2): remark #7712: This variable has not been used.integer p,q,r ------------^
even though the contained subroutine has no variables and has an empty body.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks - we'll look into this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This has been fixed for the next major release (second half of 2016).
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