dropbox / json11

A tiny JSON library for C++11.
MIT License
2.55k stars 616 forks source link

Protect against literal interpretation #137

Closed hamiltont closed 5 years ago

hamiltont commented 5 years ago

On msvc 2017 this seems to have been checking for existence of a flag called _warning_flag

hamiltont commented 5 years ago

I'm no cmake expert, but it's looking like these bugs may be caused by a newer version of CMake changing some syntax - or perhaps the version of cmake bundled with visual studio is a bit differnet.

I'll have to grab some debug info from my setup to help diagnose this - it's a bit tricky as I'm on a VM on a remote server, so some patience would be great :)

hamiltont commented 5 years ago

@artwyman aight, I'll check it out in a bit. In the meantime maybe someone who knows more about cmake could weight in so we're not both in the dark. This seems OK to me, but I'm hesitant to call it 100% good

hamiltont commented 5 years ago

Here's a dump of the debugging info for my environment:

Microsoft Visual Studio Community 2017 Version 15.9.10 VisualStudio.15.Release/15.9.10+28307.557 Microsoft .NET Framework Version 4.7.02556 Installed Version: Community Visual C++ 2017 00369-60000-00001-AA735 Microsoft Visual C++ 2017 ASP.NET and Web Tools 2017 15.9.04012.0 Visual C++ for Linux Development 1.0.9.28218 Visual Studio Tools for CMake 1.0

Let's query the embedded cmake for a version number:

 $ & "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" --version
 cmake version 3.12.18081601-MSVC_2
 CMake suite maintained and supported by Kitware (kitware.com/cmake).
hamiltont commented 5 years ago

@artwyman CLA done, and one final patch pushed. This now works for me - I checked win10 VS2017 & 2019, as well as Mac OS X 10.14