Skip to content

Commit 5258e23

Browse files
authored
CDRIVER-3320 Add BSON_GNUC_WARN_UNUSED_RESULT to exported functions (#855)
1 parent 583213d commit 5258e23

File tree

105 files changed

+287
-181
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+287
-181
lines changed

src/libmongoc/doc/mongoc_apm_callbacks_new.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Synopsis
99
.. code-block:: c
1010
1111
mongoc_apm_callbacks_t *
12-
mongoc_apm_callbacks_new (void);
12+
mongoc_apm_callbacks_new (void) BSON_GNUC_WARN_UNUSED_RESULT;
1313
1414
Create a struct to hold event-notification callbacks.
1515

src/libmongoc/doc/mongoc_auto_encryption_opts_new.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ Synopsis
88

99
.. code-block:: c
1010
11-
mongoc_auto_encryption_opts_t *
12-
mongoc_auto_encryption_opts_new (void);
11+
mongoc_auto_encryption_opts_t *
12+
mongoc_auto_encryption_opts_new (void) BSON_GNUC_WARN_UNUSED_RESULT;
1313
1414
1515
Create a new :symbol:`mongoc_auto_encryption_opts_t`.

src/libmongoc/doc/mongoc_client_command.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ Synopsis
1717
uint32_t batch_size,
1818
const bson_t *query,
1919
const bson_t *fields,
20-
const mongoc_read_prefs_t *read_prefs);
20+
const mongoc_read_prefs_t *read_prefs)
21+
BSON_GNUC_WARN_UNUSED_RESULT;
2122
2223
This function is superseded by :symbol:`mongoc_client_command_with_opts()`, :symbol:`mongoc_client_read_command_with_opts()`, :symbol:`mongoc_client_write_command_with_opts()`, and :symbol:`mongoc_client_read_write_command_with_opts()`.
2324

src/libmongoc/doc/mongoc_client_encryption_datakey_opts_new.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ Synopsis
88

99
.. code-block:: c
1010
11-
mongoc_client_encryption_datakey_opts_t * mongoc_client_encryption_datakey_opts_new ();
11+
mongoc_client_encryption_datakey_opts_t *
12+
mongoc_client_encryption_datakey_opts_new (void) BSON_GNUC_WARN_UNUSED_RESULT;
1213
1314
Returns
1415
-------

src/libmongoc/doc/mongoc_client_encryption_encrypt_opts_new.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Synopsis
99
.. code-block:: c
1010
1111
mongoc_client_encryption_encrypt_opts_t *
12-
mongoc_client_encryption_encrypt_opts_new ();
12+
mongoc_client_encryption_encrypt_opts_new (void) BSON_GNUC_WARN_UNUSED_RESULT;
1313
1414
Returns
1515
-------

src/libmongoc/doc/mongoc_client_encryption_new.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ Synopsis
88

99
.. code-block:: c
1010
11-
mongoc_client_encryption_t *
12-
mongoc_client_encryption_new (mongoc_client_encryption_opts_t *opts,
13-
bson_error_t *error);
11+
mongoc_client_encryption_t *
12+
mongoc_client_encryption_new (mongoc_client_encryption_opts_t *opts,
13+
bson_error_t *error) BSON_GNUC_WARN_UNUSED_RESULT;
1414
1515
Create a new :symbol:`mongoc_client_encryption_t`.
1616

src/libmongoc/doc/mongoc_client_encryption_opts_new.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ Synopsis
88

99
.. code-block:: c
1010
11-
mongoc_client_encryption_opts_t * mongoc_client_encryption_opts_new (void);
11+
mongoc_client_encryption_opts_t *
12+
mongoc_client_encryption_opts_new (void) BSON_GNUC_WARN_UNUSED_RESULT;
1213
1314
Returns
1415
-------

src/libmongoc/doc/mongoc_client_find_databases_with_opts.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Synopsis
99
.. code-block:: c
1010
1111
mongoc_cursor_t *
12-
mongoc_client_find_databases_with_opts (mongoc_client_t *client,
13-
const bson_t *opts);
12+
mongoc_client_find_databases_with_opts (
13+
mongoc_client_t *client, const bson_t *opts) BSON_GNUC_WARN_UNUSED_RESULT;
1414
1515
Fetches a cursor containing documents, each corresponding to a database on this MongoDB server.
1616

src/libmongoc/doc/mongoc_client_get_collection.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ Synopsis
1111
mongoc_collection_t *
1212
mongoc_client_get_collection (mongoc_client_t *client,
1313
const char *db,
14-
const char *collection);
14+
const char *collection)
15+
BSON_GNUC_WARN_UNUSED_RESULT;
1516
1617
Get a newly allocated :symbol:`mongoc_collection_t` for the collection named ``collection`` in the database named ``db``.
1718

src/libmongoc/doc/mongoc_client_get_database.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ Synopsis
99
.. code-block:: c
1010
1111
mongoc_database_t *
12-
mongoc_client_get_database (mongoc_client_t *client, const char *name);
12+
mongoc_client_get_database (mongoc_client_t *client,
13+
const char *name) BSON_GNUC_WARN_UNUSED_RESULT;
1314
1415
Get a newly allocated :symbol:`mongoc_database_t` for the database named ``name``.
1516

0 commit comments

Comments
 (0)