Suppression of warning of an unused variable

What is the best practice at Fortran for suppressing warning messages like:

remark #7712: This variable has not been used.

only for one specific variable (to represent a function in the API that we do not want to break)?

Note. I do not want to suppress all warnings for the file

Note2: Something similar for gcc: __attribute__((__unused__))or another common C practice with MACRO

Note3: I am particularly interested in ifort, but a multicompiler would be better.

+4
source share
1 answer

Intel Fortran ( ), . - , :

if (.false.) unused=1

- :

/warn:all,nounused

Linux:

-warn all,nounused

Microsoft Fortran UNUSEDQQ - UNUSEDQQ, , . Intel Fortran .

+1

Source: https://habr.com/ru/post/1546826/


All Articles