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

Aggressively clean up warnings in public headers

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 1.28.2
    • Affects Version/s: None
    • Component/s: None
    • None
    • C Drivers
    • Not Needed

      Based on a discussion arising from CDRIVER-4813 in Slack and a recommendation from colby.pike@mongodb.com in that discussion, we need to ensure that our public headers compile without warnings when the most aggressive available warning flags are enabled.

      Here is Colby's suggestion:

      We should continue to use -I, but very very proactively check our headers against the
      most aggressive -Werror that is available for each compiler (including new ones that we aren't yet using, no need for full CI, just feed the bson.h and mongoc.h through -fsyntax-only -Werror and make sure it comes out clean.)

      In a further discussion it was pointed out that while clang has a -Weverything option that enables every possible warning, the corresponding gcc -Wall does not actually enable all possible warnings. For each compiler it will be necessary to determine the correct invocation that enables the maximum possible number of warnings and then selectively disable any which may not make sense in our context.

            Assignee:
            josh.siegel@mongodb.com Josh Siegel
            Reporter:
            roberto.sanchez@mongodb.com Roberto Sanchez
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: