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

Fix unresolved pedantic warnings

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

      C driver commit d6984c8331a2bcd2ff0d2850b222d00c20f6a079 fixed almost all of the GCC pedantic warnings in the code base (c.f., CDRIVER-3576). However, there was one class of warning where GCC complained of converting between function pointers and object pointers. These still need to be resolved.

      The following code block exists in several files in the code base:

      /*
       * Prevent failing on pedantic GCC warning: "ISO C forbids conversion of
       * function pointer to object pointer type.
       */
      #if __GNUC__ > 6
      #pragma GCC diagnostic warning "-Wpedantic"
      #else
      #pragma GCC diagnostic warning "-pedantic"
      #endif
      

      These are the files:

      • src/libmongoc/tests/TestSuite.c
      • src/libmongoc/tests/test-mongoc-client-session.c
      • src/libmongoc/tests/test-mongoc-cursor.c
      • src/libmongoc/tests/test-mongoc-long-namespace.c

      In order to properly fix this, the above referenced code block needs to be removed from those files and the code built with the options -pedantic -Wall -Werror. Note that -pedantic and -Wall are defaults when maintainer flags are enabled. However, -Werror is not standard.

        1. build.log
          194 kB
          Jeremy Mikola

            Assignee:
            ezra.chung@mongodb.com Ezra Chung
            Reporter:
            roberto.sanchez@mongodb.com Roberto Sanchez
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: