feat(tidy): add fairmq-bugprone-unchecked-transfer-result

- Report Receive() calls whose result is discarded. On a timeout, an
  error or an interrupt the message stays empty, and only the result
  tells.
- Report Send() too with the option CheckSend: true. Off by default,
  because many devices ignore the result of Send() on purpose.
- A cast to void discards the result on purpose and is not reported.
- Add Transfer.h with matchers for Send() and Receive() of Device,
  Channel and Socket, and isDiscarded(), for this and later checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-11-09 23:14:00 +00:00
parent 64ec4d7afa
commit 3b3446bfcb
8 changed files with 254 additions and 1 deletions

View File

@@ -47,6 +47,10 @@ add_library(fairmq-tidy-module OBJECT
ProgOptionsAccessorsCheck.h
RunDeviceCheck.cxx
RunDeviceCheck.h
Transfer.cxx
Transfer.h
UncheckedTransferResultCheck.cxx
UncheckedTransferResultCheck.h
)
target_compile_features(fairmq-tidy-module PUBLIC cxx_std_17)
target_include_directories(fairmq-tidy-module