- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page