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

incompatible pointer to integer conversion

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.5.0
    • Affects Version/s: 1.5.0
    • Component/s: None
    • None

      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]              ^~~~
      
      
      

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            bjori Hannes Magnusson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: