pw_software_update: Fix some compiler warnings
Tested: Downstream project builds.
Change-Id: Ie6ac4e934149f1a33cf5ee373f472c63e3e7de97
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/110118
Reviewed-by: Fateh Singh <fsingh@google.com>
Commit-Queue: Fateh Singh <fsingh@google.com>
Reviewed-by: Ali Zhang <alizhang@google.com>
diff --git a/pw_software_update/update_bundle_accessor.cc b/pw_software_update/update_bundle_accessor.cc
index fdcb832..e134fb6 100644
--- a/pw_software_update/update_bundle_accessor.cc
+++ b/pw_software_update/update_bundle_accessor.cc
@@ -167,7 +167,7 @@
}
PW_LOG_ERROR("Insufficient signatures. Requires at least %u, verified %zu",
- threshold.value(),
+ static_cast<unsigned>(threshold.value()),
verified_count);
return Status::Unauthenticated();
}
@@ -494,8 +494,8 @@
if (trusted_root_version.value() > new_root_version.value()) {
PW_LOG_ERROR("Root attempts to rollback from %u to %u",
- trusted_root_version.value(),
- new_root_version.value());
+ static_cast<unsigned>(trusted_root_version.value()),
+ static_cast<unsigned>(new_root_version.value()));
return Status::Unauthenticated();
}
@@ -630,8 +630,8 @@
PW_TRY(new_version.status());
if (current_version.value() > new_version.value()) {
PW_LOG_ERROR("Blocking Targets metadata rollback from %u to %u",
- current_version.value(),
- new_version.value());
+ static_cast<unsigned>(current_version.value()),
+ static_cast<unsigned>(new_version.value()));
return Status::Unauthenticated();
}
@@ -725,8 +725,8 @@
// TODO(alizhang): Add unit tests for all failure conditions.
Status UpdateBundleAccessor::VerifyOutOfBundleTargetPayload(
std::string_view target_name,
- protobuf::Uint64 expected_length,
- protobuf::Bytes expected_sha256) {
+ [[maybe_unused]] protobuf::Uint64 expected_length,
+ [[maybe_unused]] protobuf::Bytes expected_sha256) {
#if PW_SOFTWARE_UPDATE_WITH_PERSONALIZATION
// The target payload is "personalized out". We we can't take a measurement
// without backend help. For now we will check against the device manifest
@@ -782,7 +782,7 @@
return OkStatus();
#else
- PW_LOG_ERROR("Target file %s not found in bundle", target_name);
+ PW_LOG_ERROR("Target file %s not found in bundle", target_name.data());
return Status::Unauthenticated();
#endif // PW_SOFTWARE_UPDATE_WITH_PERSONALIZATION
}