2 ms·
Two main reasons: Many warnings that a static analyzer will emit are quite costly to detect, so the compilation would get slower. And since compilation speed is
by deng 8y ago
Two main reasons: Many warnings that a static analyzer will emit are quite costly to detect, so the compilation would get slower. And since compilation speed is an important benchmark (if not the most important), one would usually not sacrifice this for some warning.
Also, people usually do not accept false-positives in compiler warnings. Static analyzers often have heuristics to detect typos like these:
a.x = x;
a.y = y;
a.y = z; <==
But those heuristics will usually also emit false-positives. This is why pretty much all static analyzers have an easy way to suppress warnings for a certain line (usually through a "magic comment"), but suppressing compiler warnings for a single line is much more cumbersome, since it has to be done through the preprocessor.
- pjmlp 8y agoThat is why it should at very least, be turned on the CI server.