2

Do compiler warnings slow down the compilation process? For my purposes I am specifically looking at C++ compilation, using cl.exe via Team City.

Robert Greiner's answer to this question indicates that warnings do make a difference to compilation speed, but there seems to be no consensus or confirmation link.

As background, the code I've inherited generates 606 warnings.

Community
  • 1
  • 1
Chris Spicer
  • 2,144
  • 1
  • 13
  • 22
  • 5
    Rather focus on fixing these warnings – Sebastian Hoffmann Mar 06 '14 at 15:53
  • 3
    "Improving the build time" would be a great business justification for fixing those warnings. – Chris Spicer Mar 06 '14 at 15:56
  • 5
    Warnings slow the programmer who is looking at the compiler output. – interjay Mar 06 '14 at 15:59
  • 4
    Agreed, though I'd not like this question to turn into a discussion on the merits of clearing up warnings (we all know it's the right thing to do). – Chris Spicer Mar 06 '14 at 16:02
  • 1
    Yes, any output to the screen or terminal slows down the compilation process. So get rid of them by changing your code! – Thomas Matthews Mar 06 '14 at 16:26
  • The number of warnings needs to have a lines of code (LOC) account or it could be misinterpreted (such as 606 warnings for 10 lines of code versus 606 warnings for 6000 lines of code). – Thomas Matthews Mar 06 '14 at 16:28
  • 1
    In clang warnings/errors slow down compilation much more significantly than in Visual C++, although the error messages in clang are excellent. Producing useful warning/error messages takes significant effort for compiler developers especially in case of a screwed up language as C++. I'm pretty sure that dumping error messages to stdout/stderr already slows down the compilation but processing/producing the error messages also takes time especially in case of clang. – pasztorpisti Mar 06 '14 at 16:29

0 Answers0