Recently, I received several customer issues about how to handle warning messages in Intel compiler. To ease customer this kind of question, I summary related information of warnings, errors and remarks here.
Remark messages report common but sometimes unconventional use of C or C++. The compiler does not print or display remarks unless you specify the /W4 option. Remarks do not stop translation or linking. Remarks do not interfere with any output files. The following are some representative remark messages:
Warning messages report legal but questionable use of the C or C++. The compiler displays warnings by default. You can suppress all warning messages with the /w compiler option. Warnings do not stop translation or linking. Warnings do not interfere with any output files. The following are some representative warning messages:
These messages report syntactic or semantic misuse of C or C++. The compiler always displays error messages. Errors suppress object code for the module containing the error and prevent linking, but they allow parsing to continue to detect other possible errors. Some representative error messages are:
Use the following compiler options to control remarks, warnings, and errors:
Disables all warning messages
Disables warnings; displays errors
/W1, /W2; -W1, -W2
Displays warnings and errors.
Displays remarks, warnings, and errors. This level is recommended for production purposes
/W4, /Wall; -W4, -Wall
Displays all level 3 (n=3) warnings plus informational warnings, which in most cases can be safely ignored.
Displays all remarks, warnings, and errors. This setting produces the most diagnostic messages
Display brief one-line diagnostics
Enable more strict diagnostics
Change all warnings and remarks to errors
Change all warnings to errors
You can also control the display of diagnostic information with variations of the /Qdiag compiler option. This compiler option accepts numerous arguments and values, allowing you wide control over displayed diagnostic messages and reports.
Some of the most common variations include the following:
Enables a diagnostic message or a group of messages
Disables a diagnostic message or a group of messages
Tells the compiler to change diagnostics to warnings
Tells the compiler to change diagnostics to errors
Tells the compiler to change diagnostics to remarks (comments)
The list items can be specific diagnostic IDs, one of the keywords warn, remark, or error, or a keyword specifying a certain group (par, vec, sc, driver, thread, par, port-linux,, sc,openmp).
Other diagnostic-related options include the following:
Tells the compiler to print all enabled diagnostic messages and stop compilation
Causes the results of diagnostic analysis to be output to a file
Causes the results of diagnostic analysis to be appended to a file
Specifies the maximum number of errors allowed before compilation stops