Boost logo

Geometry :

Subject: Re: [geometry] Compiler warnings in geometry 1.50.0
From: Mateusz Loskot (mateusz_at_[hidden])
Date: 2012-07-09 04:40:56

On 9 July 2012 08:40, Volker Schöch <vschoech_at_[hidden]> wrote:
>> Or, could you wrap the #include with #pragma warning to disable these annoyances locally?
>> It usually takes 3 lines of code, including push and pop, and works well.
> Mateusz, thank you for your suggestion. That's exactly what I do now (and have been doing with warnings in older boost versions).
> I'm fine with that solution for the moment, but when I update to a new version of boost,
> obviously I want to eliminate any #pragma warnings that are no longer relevant.


Yes, I follow similar approach.
FYI, at work I have to use /W4 and /WX flags with Visual Studio, so
it's important to clear warnings for me.
Unfortunately, there are some troublemakers in Boost, like Boost
String Algorithms (at least until pre-1.49)
So, I have to work around it with something like this:

#pragma warning(push)
#pragma warning(disable: 4996) // 'std::_Copy_impl': Function call
with parameters that may be unsafe
#include <boost/algorithm/string/join.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/trim.hpp>
#pragma warning(pop)

> Collecting the new warnings was a byproduct of that process and I just thought I'd let you know.

Sure, I think it does not hurt to tend to zero warnings policy.
It is also advised by the Boost policy

But, as Barend explained, sometimes it is not possible to achieve
without messing the code.

Best regards,

Mateusz Loskot,

Geometry list run by mateusz at