[CDRIVER-1919]  incompatible pointer to integer conversion Created: 15/Nov/16  Updated: 27/Nov/16  Resolved: 15/Nov/16

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

Type: Improvement Priority: Major - P3
Reporter: Hannes Magnusson Assignee: A. Jesse Jiryu Davis
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The OPT_BSON_ERR() macro returns NULL on failure, but the macro is also used in functions that expect to return booleans.

 
[2016/11/14 17:16:21.703] src/mongoc/mongoc-cursor.c:901:7: error: incompatible pointer to integer conversion returning 'void *' from a function with result type 'bool' (aka 'signed char') [-Werror,-Wint-conversion]
[2016/11/14 17:16:21.703]       OPT_BSON_ERR ("Invalid 'opts' parameter.");
[2016/11/14 17:16:21.703]       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[2016/11/14 17:16:21.703] src/mongoc/mongoc-cursor.c:860:14: note: expanded from macro 'OPT_BSON_ERR'
[2016/11/14 17:16:21.703]       return NULL; \
[2016/11/14 17:16:21.703]              ^~~~
 



 Comments   
Comment by Githook User [ 27/Nov/16 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-1919: Fix return value
Branch: r1.5
https://github.com/mongodb/mongo-c-driver/commit/a2155623289adafe4be643d0902bfc5c1c4bf758

Comment by Githook User [ 17/Nov/16 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-1919: Fix return value
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/fc164adeeef21f94ae80f133077ccfdf94546dfa

Comment by Githook User [ 16/Nov/16 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-1919: Fix return value
Branch: r1.5
https://github.com/mongodb/mongo-c-driver/commit/4e219809dd512de16eb3cf012eea07afaa26fd9d

Comment by Githook User [ 15/Nov/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-1919 warning in mongoc-cursor.c
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/1e94555c5333500284bb906ef87ecbdd6f52d2e7

Generated at Wed Feb 07 21:13:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.