[gdal-dev] C4251 warnings in VS2017

Mateusz Loskot mateusz at loskot.net
Tue Jun 11 10:36:38 PDT 2019


On 19-06-11 16:48:48, Even Rouault wrote:
>On mardi 11 juin 2019 16:37:46 CEST Mateusz Loskot wrote:
>> On Tue, 11 Jun 2019 at 16:20, Michel Dastous <Michel.Dastous at bentley.com>
>wrote:
>> > Im asking because ticket #4099 was closed saying it should no longer be an
>> > issue with MSVC2015, so I was expecting it to be fixed in VS2017.
>> Right, I missed that one.
>
>I think we would accept a pull request that would change public header files
>that trigger that warning to essentially do (untested !)
>
>#ifdef _MSC_VER
>#pragma warning( push )
>#pragma warning( disable : 4251 ) // class 'foo' needs to have dll-interface
>#endif
>
>...
>
>#ifdef _MSC_VER
>#pragma warning( pop )
>#endif

Indeed, and that's perfectly reasonable solution for this issue.

Best regards
-- 
Mateusz Loskot, http://mateusz.loskot.net
Fingerprint=C081 EA1B 4AFB 7C19 38BA  9C88 928D 7C2A BB2A C1F2


More information about the gdal-dev mailing list