Skip to content

Avoid redundant depreciation warnings in Visual Studio 2012 #668

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

Closed
wants to merge 3 commits into from
Closed

Avoid redundant depreciation warnings in Visual Studio 2012 #668

wants to merge 3 commits into from

Conversation

lanzkron
Copy link
Contributor

See the following stackoverflow question, deprecation warnings will show up even if nothing is used.

Note: I'm not able to clone the repository to my computer at the moment so this pull request was created on the web, please make sure it's OK.

@lanzkron lanzkron changed the title Avoid redundant depreciation warnings in Visual Studio Avoid redundant depreciation warnings in Visual Studio 2012 Sep 11, 2017
@cdunn2001 cdunn2001 mentioned this pull request Sep 11, 2017
@cdunn2001
Copy link
Contributor

Moved to #669.

@cdunn2001 cdunn2001 closed this Sep 11, 2017
@jpo38
Copy link

jpo38 commented Sep 12, 2017

@cdunn2001 Note that VS still reports deprectaed warning for StyledStreamWriter attributes childValues_, indentString_, indentation_ when json.h is included...it's unclear why it does that.

d:\dev\vobs_ext_2015\libcpp\jsoncpp\jsoncpp-1.8.3\include\json\writer.h(283): warning C4996: 'Json::StyledStreamWriter::childValues_': Use StreamWriterBuilder instead
d:\dev\vobs_ext_2015\libcpp\jsoncpp\jsoncpp-1.8.3\include\json\writer.h(310): note: see declaration of 'Json::StyledStreamWriter::childValues_'
d:\dev\vobs_ext_2015\libcpp\jsoncpp\jsoncpp-1.8.3\include\json\writer.h(283): warning C4996: 'Json::StyledStreamWriter::indentString_': Use StreamWriterBuilder instead
d:\dev\vobs_ext_2015\libcpp\jsoncpp\jsoncpp-1.8.3\include\json\writer.h(312): note: see declaration of 'Json::StyledStreamWriter::indentString_'
d:\dev\vobs_ext_2015\libcpp\jsoncpp\jsoncpp-1.8.3\include\json\writer.h(283): warning C4996: 'Json::StyledStreamWriter::indentation_': Use StreamWriterBuilder instead
d:\dev\vobs_ext_2015\libcpp\jsoncpp\jsoncpp-1.8.3\include\json\writer.h(314): note: see declaration of 'Json::StyledStreamWriter::indentation_'

@cdunn2001
Copy link
Contributor

@jpo38, So we do need to push/pop the same thing for StyledStreamWrite? Or do we need to push a different suppression number? (I have no easy way to test this.)

@jpo38
Copy link

jpo38 commented Sep 13, 2017

Yes, apparently this fixes it. And you'll later get the deprecated warning if you instantiate the class, what's expected.

@cdunn2001
Copy link
Contributor

I unpushed. StyledStreamWriter should now suppress the warnings. Let me know if there is a problem.

@jpo38
Copy link

jpo38 commented Sep 14, 2017

Works fine now.

By the way, did you get a chance to test this with g++. Because maybe it will complain that pragma is not recognized. You may need to protect the added lines by a #ifdef _MSC_VER check.

Thank you for the quick fix.

@cdunn2001
Copy link
Contributor

We test both gcc and clang on Linux in TravisCI, and Microsoft on AppVeyor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants