Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

-warn unused

timconnors
Beginner
642 Views
Intel Fortran Compiler for 32-bit applications, Version 8.0 Build 20040412Z Package ID: l_fc_pc_8.0.046
Copyright (C) 1985-2004 Intel Corporation. All rights reserved.
Intel Fortran 8.0-4307


I've got a bunch of functions that take several arguments for historical reasons that are no longer used. I may choose to reinstate their usage later, so I don't want to remove them from the function, and all the callers. But unfortunately, -warn all (or just -warn unused) clutters up my buiild logs with function paramaters that aren't used, possibly hiding real warnings that I should worry about.

Could I request that ifc come with -warn nounusedparameters or similar, that I can use alongside -warn all (it's the only warning I don't want to be told about)? `-warn unused' should imply `-warn unusedparameters', but `-warn nounusedparameters' should not imply `-warn nounused'

Thanks.
0 Kudos
2 Replies
Steven_L_Intel1
Employee
642 Views
Well, you could always do what Microsoft did in their examples - add a call to UNUSEDQQ passing the argument. It does nothing, but satisfies the compiler. The routine still exists, but is not documented.
0 Kudos
Steven_L_Intel1
Employee
642 Views
I'd like to suggest a better approach - do something with the unused arguments in the routine to satisfy the compiler and to let the reader know that these are deliberately unused. Microsoft Fortran PowerStation had an UNUSEDQQ library routine which it used for this purpose - you would see CALL UNUSEDQQ(unusedarg) in their samples. You could do that, or something as simple as adding a dummy assignment (which the compiler would then throw away), such as :
unused = unusedarg
Of course, you'd then have to declare "unused"!
I don't see us making -warn unused more "fine grained".
0 Kudos
Reply