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

-check , -warn and -diag-enable=all

Vishnu
Novice
387 Views

All three of those compiler flags seem to do similar things. Can someone explain the differences, and whether it would be a good idea to use them all together whenever I make changes, and review my code?

0 Kudos
1 Solution
Kevin_D_Intel
Employee
387 Views

Here are the User Guide references and brief synopsis.

-diag-enable (https://software.intel.com/en-us/node/678271) offers user control the display of diagnostic information during compilation. It does not enable any compile-time or run-time checking.

-check (https://software.intel.com/en-us/node/678224) enables specific checks within the program at run-time. There are many different checks available. Many people do enable all checks initially when verifying new code. Specific checks tend to be enabled when attempting to solve a specific type of failure.

-warn (https://software.intel.com/en-us/node/678280) enables additional compile-time warnings and checks to be performed. There are many different selections available. Again, many do enable all checks initially when verifying new code and tailor to specific selections. Many use –warn stderrors (or –stand) to enable informative messages regarding nonstandard language elements.

It is a good practice to use these when developing and reviewing new code. They can be very helpful. They can be used together or in different ways. –warn issues compile-time warnings so one might choose to address those before ever executing the code thus perhaps there’s no need to use –check simultaneously (at least initially) given the latter enables run-time checks. –diag-enable really only has applicability where one desires to filter diagnostic messages which may not necessarily be applicable (at least initially) when enabling –warn given its purpose is to enable additional compile-time checks and thus increase the compiler’s verbosity about the language elements of the code.

I expect others can help guide on their use of these options for their development.

View solution in original post

0 Kudos
1 Reply
Kevin_D_Intel
Employee
388 Views

Here are the User Guide references and brief synopsis.

-diag-enable (https://software.intel.com/en-us/node/678271) offers user control the display of diagnostic information during compilation. It does not enable any compile-time or run-time checking.

-check (https://software.intel.com/en-us/node/678224) enables specific checks within the program at run-time. There are many different checks available. Many people do enable all checks initially when verifying new code. Specific checks tend to be enabled when attempting to solve a specific type of failure.

-warn (https://software.intel.com/en-us/node/678280) enables additional compile-time warnings and checks to be performed. There are many different selections available. Again, many do enable all checks initially when verifying new code and tailor to specific selections. Many use –warn stderrors (or –stand) to enable informative messages regarding nonstandard language elements.

It is a good practice to use these when developing and reviewing new code. They can be very helpful. They can be used together or in different ways. –warn issues compile-time warnings so one might choose to address those before ever executing the code thus perhaps there’s no need to use –check simultaneously (at least initially) given the latter enables run-time checks. –diag-enable really only has applicability where one desires to filter diagnostic messages which may not necessarily be applicable (at least initially) when enabling –warn given its purpose is to enable additional compile-time checks and thus increase the compiler’s verbosity about the language elements of the code.

I expect others can help guide on their use of these options for their development.

0 Kudos
Reply