[MONGOCRYPT-168] Build with clang-tidy in evergreen Created: 14/Jul/19  Updated: 28/Oct/23  Resolved: 19/Jul/19

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

Type: Improvement Priority: Major - P3
Reporter: Kevin Albertson Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: testing
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: Build libmongocrypt library

 Description   

Doing a one-off test with clang-tidy seems to surface some potential bugs:

> clang-tidy src/mongocrypt-ctx.c
 
/Users/kevinalbertson/code/libmongocrypt/src/mongocrypt-ctx.c:41:27: warning: Access to field 'status' results in a dereference of a null pointer (loaded from variable 'ctx') [clang-analyzer-core.NullDereference]
   _mongocrypt_set_error (ctx->status,
                          ^
/Users/kevinalbertson/code/libmongocrypt/src/mongocrypt-ctx.c:481:8: note: Assuming 'ctx' is null
   if (!ctx || !ctx->initialized) {

We should investigate and fix any clang-tidy/scan-build warnings and build in evergreen with clang-tidy.



 Comments   
Comment by Githook User [ 19/Jul/19 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CDRIVER-3238 analyze with clang-tidy
Branch: master
https://github.com/mongodb/libmongocrypt/commit/75da42a5dce114dad77c3d0bdc8c31c0a74e2e18

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