chore: add more clang-tidy diagnostic suppressions

This commit is contained in:
Marcus Holland-Moritz 2025-03-16 09:11:55 +01:00
parent c3491befa1
commit 8f9e3cde23
7 changed files with 8 additions and 5 deletions

View File

@ -61,6 +61,7 @@ std::string get_jemalloc_version() {
j = JEMALLOC_VERSION;
#else
size_t s = sizeof(j);
// NOLINTNEXTLINE(bugprone-multi-level-implicit-pointer-conversion)
::mallctl("version", &j, &s, nullptr, 0);
#endif
std::string rv{j};

View File

@ -113,7 +113,7 @@ try_get_block_decompressor(std::shared_ptr<mmif> mm, fs_section const& sec) {
if (sec.check_fast(*mm)) {
try {
return get_block_decompressor(std::move(mm), sec);
} catch (std::exception const&) {
} catch (std::exception const&) { // NOLINT(bugprone-empty-catch)
}
}

View File

@ -768,7 +768,7 @@ check_metadata(logger& lgr, global_metadata::Meta const& meta, bool check) {
}
}
return meta;
return meta; // NOLINT(bugprone-return-const-ref-from-parameter)
}
template <typename T>

View File

@ -150,7 +150,7 @@ check_metadata_consistency(logger& lgr, global_metadata::Meta const& meta,
if (force_consistency_check) {
global_metadata::check_consistency(lgr, meta);
}
return meta;
return meta; // NOLINT(bugprone-return-const-ref-from-parameter)
}
void analyze_frozen(std::ostream& os,

View File

@ -265,7 +265,7 @@ void file::scan(mmif* mm, progress& prog,
while (s >= chunk_size) {
cs.update(mm->as<void>(offset), chunk_size);
// release_until() is best-effort, we can ignore the return value
// NOLINTNEXTLINE(bugprone-unused-return-value)
// NOLINTNEXTLINE(bugprone-unused-return-value,cert-err33-c)
mm->release_until(offset);
offset += chunk_size;
s -= chunk_size;

View File

@ -386,7 +386,7 @@ class inode_ : public inode {
while (size >= chunk_size) {
scanner(mm->span(offset, chunk_size));
// release_until() is best-effort, we can ignore the return value
// NOLINTNEXTLINE(bugprone-unused-return-value)
// NOLINTNEXTLINE(bugprone-unused-return-value,cert-err33-c)
mm->release_until(offset);
offset += chunk_size;
size -= chunk_size;

View File

@ -319,8 +319,10 @@ void checked_reply_err(LogProxy& log_, fuse_req_t req, T&& f) {
#endif
#if DWARFS_FUSE_LOWLEVEL
// NOLINTBEGIN(bugprone-macro-parentheses)
#define dUSERDATA \
auto& userdata = *reinterpret_cast<dwarfs_userdata*>(fuse_req_userdata(req))
// NOLINTEND(bugprone-macro-parentheses)
#else
#define dUSERDATA \
auto& userdata = \