4 ms·
If you maintain one of the rare codebases that would break, then just add "--std=c++98" to your compiler flags. GCC has already been getting steadily more stri
by koenigdavidmj 11y ago
If you maintain one of the rare codebases that would break, then just add "--std=c++98" to your compiler flags.
GCC has already been getting steadily more strict by default, or at least opt-in with -Wall -Werror. The last time we updated our build environment, we had to go in and #include all the headers that were formerly implicit (or #include-d by other headers), and add in the 'const' every time we referred to a string literal. The possibly-unassigned variable checker also got a lot more sophisticated and now would enter called functions.
- GFK_of_xmaspast 11y agoI've been lead to believe that gcc can't / won't add warnings to -Wall precisely because of all the codebases that have -Werror.
- cpeterso 11y agoNew versions of gcc routinely fail to compile Firefox out of the box. A good example was gcc 4.7's -Wunused-local-typedefs, which is part of -Wall. Local typedefs seem to be a common pattern in Firefox's generated C++ (for IDL bindings).
- andrewchambers 11y agoThis is why I think static bug checking and compiling should be two different tools. There is no reason to fail a build which used to run, even if it has bugs. Doing all those checks at build time is slowing the build down too.
- deleted 11y ago[deleted]
- plorkyeran 11y agoSplitting static checks and compiling into separate tools will not prevent your builds from breaking when you update your tools if you have your build process deliberately configured to break whenever a new warning appears. GCC adding new warnings will not break your builds if you do not specifically ask for it to by using -Werror (or having your CI system reject any builds that produce warnings). At least with clang, -Weverything is not measurably slower than no warnings at all on any vaguely realistic code base.
- andrewchambers 11y agoA CI server is totally different to downloading a tarball and trying to run it. Using -Wall and -Werror in that situation is a terrible annoyance. With regard to speed, I just know that tcc is 10 times faster than gcc, and that makes a huge difference to me. Anything pointless is really irritating because I know how slow gcc is.
- GFK_of_xmaspast 11y agoThen the issue is still with the app developers who ship a tgz with -Werror as the default. (Also I'd much rather have fast binaries slowly compiled than the opposite)
- andrewchambers 11y agoObviously the issue is with the app developers. That is why I am suggesting splitting static checking and compiling, so shit developers at least stand a chance of doing the right thing. (I would rather a fast compiler until I am ready to release a final product and then swap. I probably do more cross compiling and creating custom toolchains than you.)
- GFK_of_xmaspast 11y agoIf we're worried about lousy developers being lousy, then I think we should do the absolute opposite and make -Wall the default.