Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSVC2017, 15.5 new issues. #857

Closed
aj664 opened this issue Dec 5, 2017 · 13 comments
Closed

MSVC2017, 15.5 new issues. #857

aj664 opened this issue Dec 5, 2017 · 13 comments
Assignees
Labels
platform: visual studio related to MSVC solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Milestone

Comments

@aj664
Copy link

aj664 commented Dec 5, 2017

yesterday 2017.12.05 using MSVC2017, 15.4.4 was compiling v.2.1.1 fine.
today, upgraded to MSVC2017 15.5.. now v2.1.1 has lots of std::allocator warnings/errors.

@nlohmann nlohmann added the platform: visual studio related to MSVC label Dec 5, 2017
@nlohmann
Copy link
Owner

nlohmann commented Dec 5, 2017

Related: #856

@aj664
Copy link
Author

aj664 commented Dec 5, 2017

if you aren't going to make the changes MS suggest for reasons of other-compiler compatibility, then at least add the #define the error suggests to suppress the warning.

@nlohmann
Copy link
Owner

nlohmann commented Dec 5, 2017

What is Microsoft suggesting? I am not using MSVC myself, so I am surprised that existing code would break with a new MSVC version.

@aj664
Copy link
Author

aj664 commented Dec 5, 2017

#define _SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING

if you wanted to add #if _MSC_VER >= 1912 around that too, it might help readers to understand when/if/what it's for.

@nlohmann
Copy link
Owner

nlohmann commented Dec 5, 2017

Is this relevant unless you choose C++17 as standard? Did you try whether the code of #856 still exhibits these warnings?

@aj664
Copy link
Author

aj664 commented Dec 5, 2017

I am compiling with C++17, i imagine a lot of people now do. after adding
#define _SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING
all warnings/errors have gone; and v.2.1.1 compiles without error again.

i don't see a reason not to add this #define, it's clearly something that will need to be addressed eventually. it breaks builds without it. it's a C++17 issue, not a MS specific one, it's just co-incidence the first compiler to deprecate it is the MS one. By adding this define i don't think you are hiding a bug, just a valid deprecation warning.

@nlohmann
Copy link
Owner

nlohmann commented Dec 5, 2017

If I understand correctly, #856 is addressing these warnings by solving them instead of defining away the deprecation warnings.

@aj664
Copy link
Author

aj664 commented Dec 5, 2017

I think it is attempting that, but if that fails to work because it's introducing features only supported in C++17 then that would break your C++11 support?! Aren't you trying to support C++11 still? are the proposed std::allocator_traits a supported C++11 feature?!

if the patch can not be applied because of breaking changes, then the #define _SILENCE_CXX17_OLD_ALLOC.. would allow the old code to continue to work, AND allow modern compilation to succeed.

@nlohmann
Copy link
Owner

nlohmann commented Dec 5, 2017

Seems like it's a C++11 feature: http://en.cppreference.com/w/cpp/memory/allocator_traits

@nlohmann
Copy link
Owner

nlohmann commented Dec 6, 2017

@aj664 Could you check whether #856 fixes the warnings? Alternatively, could you post the error/warning messages you mentioned in your report?

@nlohmann nlohmann added the state: needs more info the author of the issue needs to provide more details label Dec 6, 2017
@nlohmann
Copy link
Owner

nlohmann commented Dec 7, 2017

(#856 is merged, so could someone check the develop branch with MSVC2017?)

@erengy
Copy link
Contributor

erengy commented Dec 7, 2017

I can confirm that #856 fixes the following warning in Visual Studio 2017 version 15.5:

warning STL4010: Various members of std::allocator are deprecated in C++17. Use std::allocator_traits instead of accessing these members directly. You can define _SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.

I get a couple of these with v2.1.1, but the develop branch is fine.

@nlohmann nlohmann added solution: proposed fix a fix for the issue has been proposed and waits for confirmation and removed state: needs more info the author of the issue needs to provide more details labels Dec 7, 2017
@nlohmann nlohmann added this to the Release 3.0.0 milestone Dec 7, 2017
@nlohmann nlohmann self-assigned this Dec 7, 2017
@nlohmann
Copy link
Owner

nlohmann commented Dec 7, 2017

Thanks a lot!

@nlohmann nlohmann closed this as completed Dec 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: visual studio related to MSVC solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
Development

No branches or pull requests

3 participants