[RFC] : Compiling libstdc++ with warnings on

chris jefferson caj@cs.york.ac.uk
Wed Dec 14 18:30:00 GMT 2005


Every so often someone brings up some reason libstdc++ should compile
with a higher warning level. I decided to see how hard it is to compile
the test suite with -Wextra, and got the following:

1) There are a small number of bugs in the testsuite headers (all
functions without a return statement which don't return void)
2) A large number of "unused variables" in various tests (easy to fix
with the unused attribute).

In the actual library, there were only 2 real problems. Both tuple<>
(that is, the empty tuple) and bitset<0> produce a number of warnings,
involving either unused parameters or redundant tests. The only way to
fix these is to specialize some functions for the empty tuple and bitset<0>.

Does having these overloads and a bunch of __attribute__((unused)) in
lots of tests seem reasonable? Or not worth the effort?



More information about the Libstdc++ mailing list