[CXX-1226] Resolve json.cpp compile warnings introduced by deprecation of bson_as_json Created: 23/Feb/17  Updated: 27/Oct/23  Resolved: 23/Mar/17

Status: Closed
Project: C++ Driver
Component/s: Build
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: J Rassi Assignee: J Rassi
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
backported by CXX-1232 Backport 'CXX-1226 Resolve json.cpp c... Closed
Depends
depends on CXX-1056 Add mechanism to disable deprecation ... Closed

 Description   

As of the upcoming 1.7.0 libbson release, bson_as_json() is being deprecated by the introduction of bson_as_extended_json(). See related ticket CDRIVER-1947.

We should disable this deprecation warning via CXX-1056.

Example of the output being generated by this warning:

[2017/02/22 18:53:36.239] /data/mci/b73b54737441c65057f5e95736a1bde9/mongo-cxx-driver/src/bsoncxx/json.cpp:52:19: error: 'bson_as_json' is deprecated [-Werror,-Wdeprecated-declarations]
[2017/02/22 18:53:36.239]     auto result = bson_as_json(&bson, &size);
[2017/02/22 18:53:36.239]                   ^
[2017/02/22 18:53:36.239] /data/mci/b73b54737441c65057f5e95736a1bde9/mongo-cxx-driver/../mongoc/include/libbson-1.0/bson.h:508:1: note: 'bson_as_json' has been explicitly marked deprecated here
[2017/02/22 18:53:36.239] bson_as_json (const bson_t *bson, size_t *length)
[2017/02/22 18:53:36.239] ^
[2017/02/22 18:53:36.268] 1 error generated.



 Comments   
Comment by J Rassi [ 23/Mar/17 ]

As of CDRIVER-2077, bson_as_json() is no longer deprecated in libbson master, so there are no longer any compiler warnings to address. Closing as "Gone away".

Comment by Githook User [ 23/Feb/17 ]

Author:

{u'username': u'jrassi', u'name': u'J. Rassi', u'email': u'rassi@10gen.com'}

Message: CXX-1056 Temporarily add -Wno-error=deprecated-declarations to compile

This is necessary to work around the fact that the driver currently
calls into deprecated libbson functionality (see CXX-1226 for
details). "-Wno-error=deprecated-declarations" will be removed as
part of the resolution of CXX-1056.
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/438916803e0739f6c5972111ba4d14b0f060a358

Generated at Wed Feb 07 22:01:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.