ifort抑制未使用的变量警告,保持所有其他完整 [英] Ifort suppress unused variable warning, leave all others intact

查看:321
本文介绍了ifort抑制未使用的变量警告,保持所有其他完整的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用ifort和gfortran编译我的Fortran程序。

i use ifort and gfortran to compile my Fortran program.

但是我也使用同事来源,他有很多未使用的变量。
如何禁止这些编译,因为他们不是真的一个错误?

However i also use a coworkers source and he has got a lot of unused variables. How can i suppress these for the compile, seeing as they are not really an error?

但是我不想禁用 pedantic -stan ,因此需要所有其他警告。

However i dont want to disable -pedantic and -stan in the compiler options and thus want all the other warnings.

谢谢您的帮助

推荐答案

code> -warn [no] unused 。

With ifort try -warn [no]unused.

编译器可能不会将它们视为错误,但是有纪律的软件工程认为所有死和未使用的代码都是错误的;它会造成维护负担。

And, while I'm here, I suggest you remove unused variables. The compiler may not regard them as an error, but disciplined software engineering regards all dead and unused code as erroneous; it imposes a maintenance burden.

这篇关于ifort抑制未使用的变量警告,保持所有其他完整的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆