On 9/25/2015 3:43 AM, Auer, Jens wrote:
What I really don't like is that Boost makes it impossible for my code to compile the warning settings I want. What would you think of a STL delivered with your compiler that generates warnings?
It's likely that standard library implementations would generate warnings if not masked with `-isystem` or similar. For instance, libc++ only very recently started to care about warnings, nobody ever sees them due to `#pragma system_header`. Lots of warnings are of the form "you did this perfectly fine thing X, but are you sure you did not mean Y instead?". There tends to be a lot of these in implementations like Boost, the STL, and the standard library. "Did you forget to use this alias?" No, it's triggering a template instantiation that will cause a substitution failure if the arguments violate a precondition. I remember a particular piece of code that exploited properties of the comma operator, it was a single line that handled all possible input cases. Obviously the compiler suspected, "your code appears to be doing exactly what you meant it to do by abusing the comma operator, it's probably wrong", and it suspected so strongly that there was no way to shut down the warning at all while keeping use of the comma operator. This particular popular compiler forced this single line of code to be split into 8 different template specializations, true errors were introduced in this pointless duplication process. Not every warning is valuable, some are just noise, some only attempt to restrict use of the language to a particular subset, others are just simply bogus. Sometimes suppressing them is not worth the cost, sometimes they can't even be suppressed. Some warnings might be worth enforcing, turning them into errors while compiling/running tests. Blindly littering the code with `#pragma`s to silence noise doesn't really help, specially when you already have `-isystem`. Regards, -- Agustín K-ballo Bergé.- http://talesofcpp.fusionfenix.com