1

Do warnings in Xcode affect build time? Does that mean that projects that have 0 warnings compile faster than those with tons of warnings?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Jacky Coolheart
  • 297
  • 3
  • 15
  • Depends on the warning I guess. But I'd tend to say that "warn-long-expression-type-checking" is affecting it... – Larme Sep 26 '19 at 14:38
  • 1
    You are worried about the wrong thing. Fix warnings because it avoids lots of bugs in your code, not because it might compile faster. – rmaddy Sep 26 '19 at 14:50

2 Answers2

1

No it doesn't but any function or expression that exceeds 100ms will be flagged as a warning.

To decrease build time you can go through this link: How to decrease build times / speed up compile time in Xcode?

curiously77
  • 225
  • 1
  • 4
  • 24
1

My guess (and it's only a guess) is yes. Printing the warnings into the console might take some time, plus the fact of these warnings probably means that the compiler is having to do more thinking in order to parse your code, which suggests that it might be taking longer to process the build. You have access to build time statistics in the Report navigator, so it would be easy to confirm or deny this for yourself with some rudimentary testing.

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • In any case, as rmaddy says, your goal should be zero warnings. There is a build setting to treat warnings as errors, which will help you enforce that policy. :) – matt Sep 26 '19 at 15:02