Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Novice
2 Views

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

Jump to solution

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

Accepted Solutions
Highlighted
Employee
2 Views

Here are the User Guide

Jump to solution

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
Highlighted
Employee
3 Views

Here are the User Guide

Jump to solution

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