chore: Fix all clang build warnings (#4475)

* chore: Fix all clang build warnings

Also add `-Werror` to clang build in CI.

Fixes #4449

* all build targets

* fix search test
This commit is contained in:
Shahar Mike 2025-01-20 10:24:07 +02:00 committed by GitHub
parent c759eb8ce6
commit 6f3c6e3d57
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 51 additions and 69 deletions

View file

@ -955,8 +955,8 @@ OpResult<long> OpDel(const OpArgs& op_args, string_view key, string_view path,
if (json_path.HoldsJsonPath()) {
const json::Path& path = json_path.AsJsonPath();
long deletions =
json::MutatePath(path, [](optional<string_view>, JsonType* val) { return true; }, json_val);
long deletions = json::MutatePath(
path, [](optional<string_view>, JsonType* val) { return true; }, json_val);
return deletions;
}
@ -1487,7 +1487,8 @@ void JsonFamily::Set(CmdArgList args, const CommandContext& cmd_cntx) {
if (parser.Error() || parser.HasNext()) // also clear the parser error dcheck
return builder->SendError(kSyntaxErr);
auto cb = [&](Transaction* t, EngineShard* shard) {
auto cb = [&, &key = key, &path = path, &json_str = json_str](Transaction* t,
EngineShard* shard) {
return OpSet(t->GetOpArgs(shard), key, path, json_path, json_str, is_nx_condition,
is_xx_condition);
};