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

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Trivial - P5 Trivial - P5
    • 1.20.0
    • None
    • libmongoc

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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: