- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I recall discussing this in a thread somewhere but I can't seem to find it, Anyway this document
https://software.intel.com/en-us/node/520142
Suggests "DPD200256205 Have -warn unused warn about unused ONLY names" is in the new release. I took this to mean that:
USE FRED, ONLY: bill, alan, peter
would throw a warning if for example alan was not used in the scope of the USE. I was quite looking forward to this feature, did it fall off the list at some point or have I misunderstood?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm looking forward to this feature too and my expectation is also along the lines mentioned by app4619 in the original post.
But I didn't notice such a feature in the 2015 Beta version, so it'll be surprising if it is available in the final release.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This was added late in the Beta cycle, and should be in the final product
Are you guys seeing something different?
--Lorri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Lorri Menard (Intel) wrote:
This was added late in the Beta cycle, and should be in the final product
Are you guys seeing something different?
--Lorri
I do not seem to be seeing that feature. I was expecting to have quite a number of warnings and when I didn't I deliberately created some lines that should have given a warning. Try a simple test case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hmm. Our regression test looks like this:
module cq256205mymod integer a, b, c, x end module cq256205mymod program cq256205 use cq256205mymod, only: a,b,c integer d a = 1 b = 2 print *, "success" end program
and does issue two warnings when compiled as:
ifort /warn:unused cq256205.f90
One message for "d" one message for "c"
What is different about your example?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes that example works for me also. The example I tried where in a large application with many modules etc. There are also different build options e.g. I only check the warning on debug builds. I will investigate further and report back.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It does not warn when the "unused only" is within a module procedure it would seem. No warning for "c". As all my routines are usually within modules that appears to be why I get no warnings.
module cq256205mymod
implicit none
integer a, b, c, x
end module cq256205mymod
module fred
contains
subroutine bill
use cq256205mymod, only: a,b,c
implicit none
integer f
a = 1
b = 2
print *, "success"
end subroutine bill
end module fred
program cq256205
use cq256205mymod, only: a,b
use fred
implicit none
integer d
a = 1
b = 2
print *, "success"
call bill()
end program
1>------ Build started: Project: Console3, Configuration: Debug Win32 ------
1>Compiling with Intel(R) Visual Fortran Compiler XE 15.0.0.108 [IA-32]...
1>Console3.f90
1>C:\Users\Andrew\Documents\Cadfil\cadfil_devt_intel\Console3\Console3.f90(11): remark #7712: This variable has not been used.
1>C:\Users\Andrew\Documents\Cadfil\cadfil_devt_intel\Console3\Console3.f90(22): remark #7712: This variable has not been used.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for the investigation --- I'll send that info over the wall to my colleague.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
app4619 wrote:
.. As all my routines are usually within modules that appears to be why I get no warnings...
Same situation with me; almost all the code is in modules.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Lorri Menard (Intel) wrote:
Thank you for the investigation --- I'll send that info over the wall to my colleague.
Was there any feedback on this issue ?
Regards
Andrew
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Andrew --
He acknowledged that it failed, but there's no schedule for the fix yet.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was just informed that the fix for this problem is expected to be in Update 1.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve Lionel (Intel) wrote:
I was just informed that the fix for this problem is expected to be in Update 1.
Thanks that will be most welcome :-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
And indeed is seems to be working in update 1!
I was pleasantly surprised and the relatively small number of warnings I got when doing a full rebuild of a large project :-)
it is nice to have some spring cleaning in your code even if it is winter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Depends where you are ... it's still Spring here until Monday :-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's technically not winter here for another few weeks, but we did just have our first snow of the season in southern New Hampshire.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sounds like the difference between meteorological and astronomical winter. A-basin opened last month, does that make it winter here?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
module cq256205mymod
implicit none
integer :: a, b, c, x
end module cq256205mymod
module fred
integer :: y,w
contains
subroutine bill
use cq256205mymod, only: a,b,c !c unused remark #7712
implicit none
integer f !f unused remark #7712
a = 1
b = 2
print *, "success"
end subroutine bill
end module fred
program cq256205 ! test for /warn:unused Fortran Compiler XE 15.0.1.148 [IA-32]
use cq256205mymod, only: a,b
use fred, only: y,bill ! bill is NOT reported as unused
implicit none
integer d ! d unused remark #7712
a = 1
b = 2
y = 1
print *, "success"
!call bill()
end program
I think I spoke too soon..... I noticed some issues with this feature yesterday and have updated the test that was at #7. The problem is the line
use fred, only: y,bill as it seems that unused applies to variablies and not module procedures. Perhaps that was the intention?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, it'll be nice if /warn:unused applies to module procedures too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, the option's documentation does say: "Determines whether warnings occur for declared variables that are never used." A procedure is not a variable. Nor is a type or an interface. I will enter a feature request that any identifier in a USE list qualify for the warning. Issue ID is DPD200365039.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
See recent discussion at comp.lang.fortran: https://groups.google.com/forum/#!topic/comp.lang.fortran/RedeUCqh12c
I think the warning in this case is unwaranted: thoughts?
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page