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

Compiler warnings

Dan_J_
Beginner
427 Views

I am compiling my code with icpc, it seems that despite the fact I use -Wall, intel compiler does not show most trivial of warnings, (unused variables.. uninitialized variables.. etc..) are not shown, did anyone encounter this or knows a way to fix it to truly show all warnings?

Thanks.

0 Kudos
1 Solution
Judith_W_Intel
Employee
427 Views

 

Two choices:

(1) Figure out which specific diagnostics you would like that GNU enables with specific -W options, i.e.:  -Wuninititalized or -Wunused. Since our -Wall must be compatible with GNU we do not show all remarks with -Wall.

(2) Enable all of our diagnostics by adding -Wremarks. This may give you some additional diagnostics you don't care about which you would then have to disable individually with -diag-disable.

See icpc -help for details.

Judy

View solution in original post

0 Kudos
2 Replies
Judith_W_Intel
Employee
428 Views

 

Two choices:

(1) Figure out which specific diagnostics you would like that GNU enables with specific -W options, i.e.:  -Wuninititalized or -Wunused. Since our -Wall must be compatible with GNU we do not show all remarks with -Wall.

(2) Enable all of our diagnostics by adding -Wremarks. This may give you some additional diagnostics you don't care about which you would then have to disable individually with -diag-disable.

See icpc -help for details.

Judy

0 Kudos
Kittur_G_Intel
Employee
427 Views

Also a related note: If you want to see a listing of all the diagnostics provided by the compiler you can use the -diag-dump option to dump out to a file and enable those that you are interested explicitly...

_Kittur

0 Kudos
Reply