[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] MSVC warnings for comparisons in bourn_cast
From: |
Vadim Zeitlin |
Subject: |
Re: [lmi] MSVC warnings for comparisons in bourn_cast |
Date: |
Tue, 25 Apr 2017 19:26:20 +0200 |
On Tue, 25 Apr 2017 15:04:31 +0000 Greg Chicares <address@hidden> wrote:
GC> On 2017-04-25 13:54, Vadim Zeitlin wrote:
...
GC> > probably could (but I didn't test it yet) disable the warnings just in
this
GC> > code using pragmas, as it's already done for gcc, which seems to be the
GC> > best approach, but would require having MSVC-specific pragmas in this
GC> > header and so I wanted to ask you about it before making a patch. But I
GC>
GC> That sounds best. We already do this for gcc:
GC>
GC> #pragma GCC diagnostic ignored "-Wsign-compare"
GC> #pragma GCC diagnostic ignored "-Wbool-compare"
GC>
GC> so it would seem natural to do likewise for msvc:
GC>
GC> #if defined LMI_MSC
GC> # pragma warning(disable : 4018)
GC> # pragma warning(disable : 4804)
GC> #endif // defined LMI_MSC
Please find attached the patch which does just this. I've checked that it
didn't break compilation with gcc (normally it couldn't affect it, of
course, but I don't trust things not to happen just because they seem to be
impossible any more) and it gets rid of the warnings when using MSVC.
Thanks in advance for applying it,
VZ
0001-Disable-MSVC-warnings-in-bourn_cast.hpp.patch
Description: Text document