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.
- related to
-
CXX-936 Compile with all warnings enabled and warnings as errors
- Backlog