[SERVER-69729] Enable clang-tidy check for signed char misuse Created: 15/Sep/22  Updated: 29/Oct/23  Resolved: 20/Dec/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.3.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Jordi Olivares Provencio Assignee: Matt Kneiser
Resolution: Fixed Votes: 0
Labels: post-v4-toolchain
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-62994 Upgrade server build from v3 toolchai... Closed
depends on SERVER-69784 Fix instances of signed char misuse Closed
Related
related to SERVER-69612 Audit the codebase for signed use of ... Closed
Backwards Compatibility: Minor Change
Sprint: Execution Team 2022-12-26
Participants:

 Description   

In ARM CPUs the char datatype is unsigned by default while on x86 it is signed. To avoid misuse we should enable the bugprone-signed-char-misuse clang-tidy check.



 Comments   
Comment by Matt Kneiser [ 20/Dec/22 ]

This touches very old code (represent_as), but the scope of the change is narrow. 

Comment by Githook User [ 20/Dec/22 ]

Author:

{'name': 'Matt Kneiser', 'email': 'matt.kneiser@mongodb.com', 'username': 'themattman'}

Message: SERVER-69729 Add tidy check for signed char misuse
Branch: master
https://github.com/mongodb/mongo/commit/f7313bb1cf96e3e542ac4c8ad9f932ec68164b84

Comment by Alex Neben [ 14/Dec/22 ]

That was absurdly fast! Nice job!

Comment by Alex Neben [ 14/Dec/22 ]

FYI: this is now unblocked!

Comment by Alex Neben [ 19/Sep/22 ]

The check does not exist in clang tidy 7 which I think is the one we are using in our toolchain
https://releases.llvm.org/7.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/list.html

Comment by Alex Neben [ 19/Sep/22 ]

This check should not merge until after we upgrade the toolchain. This will prevent us from upgrading the toolchain if there are regressions.

If you want to leave this PR our team can make sure this check gets enabled and you can go thru and make all the fixes by using clang-tidy v4

Comment by Matt Kneiser [ 16/Sep/22 ]

Should fix existing uses before enabling the check.

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