[CDRIVER-3320] Mark public functions that return a handle that must be freed with BSON_GNUC_WARN_UNUSED_RESULT Created: 14/Aug/19 Updated: 28/Oct/23 Resolved: 30/Aug/21 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libmongoc |
| Affects Version/s: | None |
| Fix Version/s: | 1.20.0 |
| Type: | Improvement | Priority: | Trivial - P5 |
| Reporter: | Kevin Albertson | Assignee: | Ezra Chung |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Some of our public functions, like mongoc_collection_create_bulk_operation, are marked with the attribute BSON_GNUC_WARN_UNUSED_RESULT, which gives a compiler warning if the caller does not inspect the returned value (which in that case, because they should at the very least destroy the mongoc_bulk_operation_t returned). Not all functions that return handles that must be cleaned up have this attribute, (e.g. mongoc_collection_watch and possibly others). |
| Comments |
| Comment by Githook User [ 30/Aug/21 ] |
|
Author: {'name': 'Ezra Chung', 'email': '88335979+eramongodb@users.noreply.github.com', 'username': 'eramongodb'}Message: |