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

Combination of "-diag-disable" and "-warn"

nDS
Novice
1,180 Views

It seems that I am missing a nuance of using these two guys together . . .  As follows:

 

* When I use "-diag-disable=8872" (in particular) and do _not_ use "-warn stderrors", the warning message is suppressed.

 

* When I use "-diag-disable=8872" and do use "-warn stderrors", the (now error) message is shown, with the fairly obvious preface "Cannot disable Fortran error message 8872".

 

This is really unhelpful for the current use case . . .  So, my question is whether there is any way to suppress this diagnostic (preface notwithstanding) in build time error mode?  Thanks.

 

0 Kudos
2 Replies
Steve_Lionel
Honored Contributor III
1,171 Views

Warnings can be disabled, errors cannot. In many cases, an error means that the compiler can't determine a correct interpretation of the code, so it can't continue. While standards diagnostics don't fall under that, it doesn't astonish me that if you ask for standards diagnostics to be errors that you can't then disable them.

Either you want to block non-standard usage, or you don't. Pick one. Or use standard-conforming syntax.

HarmenW
Novice
396 Views

This issue is causing us a lot of trouble. Since ifx and ifort produce many warnings that cannot be solved by a user (see Re: Re:Many "Global name too long" warnings - Intel Community), but other warnings are useful, I expect to be able to treat warnings as errors after turning off specific warnings. This is also the behaviour in every C++ compiler that I used, and it is the case for gfortran (see https://godbolt.org/z/rKExWvd7x, adding -Wno-unused-variable prevented the error).

 

Because of this shortcoming, we have had to create our own python script parsing the build log for warnings and remarks created by the intel fortran compilers. It would be greatly appreciated if this were fixed so that we can get rid of this hack.

0 Kudos
Reply