Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

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

Zhu_W_Intel
Employee
1,309 Views
When can I find the list of all warnings I can turn on for Intel C++ compilers?
Thanks.
0 Kudos
1 Solution
Dale_S_Intel
Employee
1,309 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

0 Kudos
6 Replies
JenniferJ
Moderator
1,308 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

0 Kudos
Zhu_W_Intel
Employee
1,308 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.
0 Kudos
Dale_S_Intel
Employee
1,310 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

0 Kudos
Zhu_W_Intel
Employee
1,308 Views

Great. It works for me.
0 Kudos
srimks
New Contributor II
1,308 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
0 Kudos
Zhu_W_Intel
Employee
1,308 Views
Thanks, but sorry, this is not what I want. The previous post already answered my question.
0 Kudos
Reply