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

color diagnostics in icc?

dpeterc
Beginner
1,146 Views

Is there a way to enable color diagnostics in icc like the one available in gcc 4.9 and later or clang?

http://clang.llvm.org/diagnostics.html

https://gcc.gnu.org/gcc-4.9/changes.html

https://i.stack.imgur.com/lqGAH.png

I am using icc (ICC) 17.0.1 20161005

0 Kudos
1 Solution
SergeyKostrov
Valued Contributor II
1,146 Views
>>...As a solution: you can fix warnings. Writing code without warnings is a good practice. It is a good recommendation for "toy" software projects. In a real life, as dpeterc mentioned, things are more-more complex. I support that feature and it will be very good if Intel C++ compiler team implements it. However, I wouldn't consider that feature as a high priority task. I also think it shouldn't be done in a monolithic, or not configurable, way. Intel C++ compiler has a couple of cfg files and one of them is icl.cfg. I think it could be used for that purpose. I would also take into account that Intel C++ compiler has several types of messages: - errors - warnings ( levels 1, 2, 3, 4 and 5 ) - remarks - notes and there are also linker warnings and errors. For all these types of messages different colors could be used. Please consider it in a future release of Intel C++ compiler.

View solution in original post

0 Kudos
11 Replies
Judith_W_Intel
Employee
1,146 Views

 

No sorry the Intel compiler does not have this functionality.

 

0 Kudos
dpeterc
Beginner
1,146 Views

Thank you for the answer. Maybe you can add it to the wish list, as the other compilers have it for some time.

Sometimes it is hard to find the error among many warnings, and having to cut & paste compiler diagnostics in editor, so I can search for the error is not very comfortable. If we had color diagnostics, the errors would immediately stand out.

0 Kudos
McCalpinJohn
Honored Contributor III
1,146 Views

I seem to recall seeing this capability in the DEC VAX compilers more than 20 years ago....  

You might be able to get some of the desired functionality from a colorizing version of grep.   Getting multiple colors for different messages is slightly convoluted, but not particularly hard to script.  Some potentially helpful references:

0 Kudos
SergeyKostrov
Valued Contributor II
1,146 Views
>>...Sometimes it is hard to find the error among many warnings, and having to cut & paste compiler diagnostics in editor... In case a Windows version of Intel C++ compiler integrated with Microsoft Visual Studio you can use its Intellisense functionality to color a set of key words and take a look at a usertype.dat file located at [ VSInstallDir ]\Common7\IDE folder.
0 Kudos
dpeterc
Beginner
1,146 Views

Thanks for the reply, John and Sergey. I am "old school" and compile from console on Linux.

My editor (nedit) does color syntax highlighting, "ls" is in color by file type, only intel c compiler stays monochrome ;-(

I was asking because due to high number of options, I was afraid I was overlooking the possibility of colorized diagnostics.

I think this option is relatively simple to implement, if we compare it to automatic vectorization and other advanced optimizations.

0 Kudos
SergeyKostrov
Valued Contributor II
1,146 Views
>>...I was asking because due to high number of options, I was afraid I was overlooking the possibility of >>colorized diagnostics. I think you need to look for a workaround. If Intel decides to implement that it could take some time before the feature is released.
0 Kudos
Alex_C_6
Beginner
1,146 Views

dpeterc wrote:

Sometimes it is hard to find the error among many warnings, and having to cut & paste compiler diagnostics in editor, so I can search for the error is not very comfortable. If we had color diagnostics, the errors would immediately stand out.

As a solution: you can fix warnings. Writing code without warnings is a good practice.

0 Kudos
dpeterc
Beginner
1,146 Views

Alex C. wrote:

As a solution: you can fix warnings. Writing code without warnings is a good practice.

That is what I try to do. But things are so complex that at a certain warning level you will always get something, like -Wall or -Wp64

And I don't always compile only my own code; i compile third party projects and libraries, which I don't have time to maintain; I only need to make them compile and work with minimum changes. It could be old code which does not respect current guidelines in software engineering.

0 Kudos
SergeyKostrov
Valued Contributor II
1,147 Views
>>...As a solution: you can fix warnings. Writing code without warnings is a good practice. It is a good recommendation for "toy" software projects. In a real life, as dpeterc mentioned, things are more-more complex. I support that feature and it will be very good if Intel C++ compiler team implements it. However, I wouldn't consider that feature as a high priority task. I also think it shouldn't be done in a monolithic, or not configurable, way. Intel C++ compiler has a couple of cfg files and one of them is icl.cfg. I think it could be used for that purpose. I would also take into account that Intel C++ compiler has several types of messages: - errors - warnings ( levels 1, 2, 3, 4 and 5 ) - remarks - notes and there are also linker warnings and errors. For all these types of messages different colors could be used. Please consider it in a future release of Intel C++ compiler.
0 Kudos
Frank_Illenseer
Beginner
1,146 Views

I would also vote to have coloured output of Intel compilers (i.e. general colouring to help human reading of the output and also for all of the compilers, i.e. C/C++ and Fortran). It would help visual identification and improve productivity.

Thanks, FI

0 Kudos
Alex_C_6
Beginner
1,146 Views

Sergey Kostrov wrote:

>>...As a solution: you can fix warnings. Writing code without warnings is a good practice.

It is a good recommendation for "toy" software projects. In a real life, as dpeterc mentioned, things are more-more complex.

I'm understand that it is very hard for big projects. But it is a requirement if you need a safe code, for example in network or security modules.

In a company where I'm work (http://www.radmin.com/) 0 warnings is a requirement for all code (exclude third party libraries) and this is a real life and not a "toy" projects. For example in my own "toy" projects with 3d graphics (part of them listed here) when I fix all warnings was fixed a bug with camera jerking.

And I'm agree that colorized diagnostics is a good feature.

0 Kudos
Reply