5 ms·
it's very ver hard to get an in-production project True, especially for older projects which never cared about warnings to begin with. Still when I encounter o
by stinos 5y ago
it's very ver hard to get an in-production project
True, especially for older projects which never cared about warnings to begin with. Still when I encounter one I might try it anyway, gradually if possible, to see what comes out. Not just because it is indeed just joy to have no warnings, but also because more often than not some of those warnings actually tell you there are bugs. Or for example (just had this last week) because there are projects which compile with 10k+ warnings which mean that even if you just compile a single file, it is way to hard to tell whether your new code just introduced a new warning and if so which one it is.
- jahnu 5y agoAbsolutely. One strategy I employed with a very old code base with a gajillion warnings was to output them to a file and compare against a reference file at the end of the build. If the output changed we would fix those and maybe any that kept happening if you added new compilation units etc. It at least helped us slowly reverse the trend of accumulating warnings.
- lelanthran 5y agoI did the same, but it meant that the build could not go in parallel. I also stored the warnings.txt in git so that before any commit I could simply do a git diff to see what warnings were changed by my additions.