[MONGOCRYPT-587] Build with warnings and treat them as errors Created: 22/Aug/23  Updated: 28/Oct/23  Resolved: 09/Sep/23

Status: Closed
Project: Libmongocrypt
Component/s: None
Affects Version/s: None
Fix Version/s: 1.9.0

Type: Task Priority: Unknown
Reporter: Roberto Sanchez Assignee: Roberto Sanchez
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

While working on MONGOCRYPT-512 it became evident that it would be very helpful to have -Wall -Werror as default compile options in Evergreen builds. It seems that this was done once before (MONGOCRYPT-103, commit 05bb025ffae269fe47d41e81636d98b438daf4c8) but that somehow it was changed and we no longer have this.

Note that as part of MONGOCRYPT-512 it was necessary to prune -Werror from the compiler flags before including the embedded C driver in the build. The same seems likely to be necessary for DFP when -Wall is added.



 Comments   
Comment by Githook User [ 07/Sep/23 ]

Author:

{'name': 'Roberto C. Sánchez', 'email': 'roberto@connexer.com', 'username': 'rcsanchez97'}

Message: MONGOCRYPT-587 compiler warnings (#691)

  • MONGOCRYPT-587 include -Wsign-compare when "more warnings" are enabled
  • fix compiler warnings: -Wformat-truncation
Comment by Cloud GitHub Webhooks [ 07/Sep/23 ]

rcsanchez97 merged a pull request (MONGOCRYPT-587 compiler warnings) into the following branch:
master: da4834dfbdd635bb250cdbf78e22e4de5905b717

Comment by Roberto Sanchez [ 01/Sep/23 ]

https://github.com/mongodb/libmongocrypt/pull/691

Comment by Roberto Sanchez [ 31/Aug/23 ]

My initial assessment (as recorded in the ticket description) was incorrect. The implementation of the CMake option ENABLE_MORE_WARNINGS_AS_ERRORS in libmongocrypt ensures that -Wall -Werror are added to the compiler invocations when that option is set, which it is for all of our Evergreen builds. The issue is that, according to the gcc documentation, the list of warnings enabled by -Wall, does not include -Wsign-compare.

So, it seems that the issue is really whether we want to include -Wsign-compare in addition to -Wall -Werror when the option ENABLE_MORE_WARNINGS_AS_ERRORS is set. This seems like a good thing to have.

Generated at Thu Feb 08 09:09:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.