Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-3320

Mark public functions that return a handle that must be freed with BSON_GNUC_WARN_UNUSED_RESULT

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 1.20.0
    • Affects Version/s: None
    • Component/s: libmongoc

      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).

            Assignee:
            ezra.chung@mongodb.com Ezra Chung
            Reporter:
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: