Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Zhu_W_Intel
Employee
250 Views

List of all warnings in Intel C++ compiler (for linux)

Jump to solution
When can I find the list of all warnings I can turn on for Intel C++ compilers?
Thanks.
0 Kudos

Accepted Solutions
Dale_S_Intel
Employee
250 Views

When I tried this:
icc -diag-enable:warn -diag-dump -c arraySize.cpp >& diag_warn_icc.txt
more diag_warn_icc.txt
icc: command line warning #10158: ignoring option '-diag-enable'; argument must be separate

It seems the -diag-enable is ignored.

Please help.
I am on a linux system.

The syntax is slightly different on Linux (and Mac) than it is on Windows. Try this:

icc -diag-enable warn -diag-dump -c hello.c >& diag_warn_icc.txt

That seems to work for me. Does that do what you want?

Dale

View solution in original post

6 Replies
JenniferJ
Moderator
250 Views
You can use this option to get all the diagnostics:
icc /diag-enable:warn /diag-dump /c t.c > diag_warn.txt

icc /diag-dump /c t.c > diag_all.txt

Each version, some diagnostics are added or updated.

Jennifer

Zhu_W_Intel
Employee
250 Views

When I tried this:
icc -diag-enable:warn -diag-dump -c arraySize.cpp >& diag_warn_icc.txt
more diag_warn_icc.txt
icc: command line warning #10158: ignoring option '-diag-enable'; argument must be separate

It seems the -diag-enable is ignored.

Please help.
I am on a linux system.
Dale_S_Intel
Employee
251 Views

When I tried this:
icc -diag-enable:warn -diag-dump -c arraySize.cpp >& diag_warn_icc.txt
more diag_warn_icc.txt
icc: command line warning #10158: ignoring option '-diag-enable'; argument must be separate

It seems the -diag-enable is ignored.

Please help.
I am on a linux system.

The syntax is slightly different on Linux (and Mac) than it is on Windows. Try this:

icc -diag-enable warn -diag-dump -c hello.c >& diag_warn_icc.txt

That seems to work for me. Does that do what you want?

Dale

View solution in original post

Zhu_W_Intel
Employee
250 Views

Great. It works for me.
srimks
New Contributor II
250 Views
When can I find the list of all warnings I can turn on for Intel C++ compilers?
Thanks.

Why not think and try using -

"-Weffc++" (enables warnings based on C++ guidelines)
"-Werror" (forces warnings to be reported as errors)
"-Werror-all" (change all warnings & remarks to errors)
"-diag-enable sv" (enables static-verification and n specifies severity level of diagnostics as n=1[all critical], n=2[all errors], n=3[all errors & warnings)
"-w2" (display errors, warning & remarks)

~BR
Zhu_W_Intel
Employee
250 Views
Thanks, but sorry, this is not what I want. The previous post already answered my question.