
Warnings present a difficult conundrum for Boost. I wonder if there's any way we can come up with a coherent policy, so individual library developers don't have to think through all the issues individually and our users develop consistent expectations. Here's what I know: * Some warnings that are just a nuisance, especially for templated code. For example, I am getting a warning from vc-8 that the implicit assignment operator of a particular class template instantiation couldn't be generated. I expect the availability of implicit assignment in that case to depend on the template parameter. In this case, any class template that can take reference arguments that become members of the class is susceptible. * It's impolite to unconditionally disable warnings that people may count on in their own code. The above is a nuisance for me, but it might be crucial for someone developing ordinary classes. * Some popular compilers (GCC) don't have #pragmas that let us turn off warnings in particular regions of code. On those compilers, there is sometimes no workaround in code; suppressing the warning must be done on the compiler's command-line. We can do it in Boost.Build, but of course that won't help people who are using other build systems. And for those that _are_ using Boost.Build, suppressing warnings at that point can be just as impolite as doing it in code. * Even when in-code workarounds are possible, they're often ugly, and since the workarounds (e.g. #pragmas) can be different for every compiler, they really pile up. So, ideas, anyone? -- Dave Abrahams Boost Consulting www.boost-consulting.com

David Abrahams wrote: I have this problem right now. What I want to do is the following: a) alter my Jamfiles to include command line switches to suppress the warnings in the tests and demos b) The serialization library has a section which details issues specific to each compiler. I want to add an explanation for this compiler so that a user can disable these warnings or not depending on his situation. This seems to me a good solution and in any case the best we can probably do. Robert Ramey

"Robert Ramey" wrote:
David Abrahams wrote:
I have this problem right now. What I want to do is the following:
a) alter my Jamfiles to include command line switches to suppress the warnings in the tests and demos
If you are using the latest CVS version of BBv2, you can do the following: bjam release ... warnings=off or <warnings>off in the exe/lib targets. I supplied a patch to BBv2 to add support for <warnings> and <warnings-as-errors> features :). It doesn't support selective warning disabling because it is not feasible to cover all compilers in a uniform way. At the moment only msvc, gcc, cw and borland are supported in terms of supporting the new warnings feature. If anyone knows the compiler options for warnings=all on off warnings-as-errors=off on let me know and I'll add support for the feature for that toolset.
b) The serialization library has a section which details issues specific to each compiler. I want to add an explanation for this compiler so that a user can disable these warnings or not depending on his situation.
This seems to me a good solution and in any case the best we can probably do.
I would like to see the number of warnings on the maximum level set for a compiler to be as few as possible, but understand as other people have said, that it can sometimes not be very pretty and is in general not feasible (for all compilers). - Reece
participants (3)
-
David Abrahams
-
Reece Dunn
-
Robert Ramey