This is an automated email from the ASF dual-hosted git repository.

wgtmac pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-cpp.git


The following commit(s) were added to refs/heads/main by this push:
     new 751e1f79 fix: suppress -Wunused-parameter and -Wshadow warnings under 
-Wextra (#1081)
751e1f79 is described below

commit 751e1f798d6169021ec32089e7e74712d4684887
Author: Ankit Sharma <[email protected]>
AuthorDate: Tue Nov 3 08:59:32 2026 +0530

    fix: suppress -Wunused-parameter and -Wshadow warnings under -Wextra (#1081)
---
 src/iceberg/encryption/key_management_client.h | 4 ++--
 src/iceberg/expression/binder.cc               | 8 ++++----
 src/iceberg/expression/expression.h            | 2 +-
 src/iceberg/expression/expression_visitor.h    | 4 ++--
 src/iceberg/expression/expressions.cc          | 3 ++-
 src/iceberg/expression/literal.cc              | 6 +++---
 src/iceberg/expression/manifest_evaluator.cc   | 7 ++++---
 src/iceberg/expression/projections.cc          | 2 +-
 src/iceberg/file_io.h                          | 2 +-
 src/iceberg/util/executor_util_internal.h      | 5 +++--
 10 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/src/iceberg/encryption/key_management_client.h 
b/src/iceberg/encryption/key_management_client.h
index 6d8c087b..8044d4a2 100644
--- a/src/iceberg/encryption/key_management_client.h
+++ b/src/iceberg/encryption/key_management_client.h
@@ -54,7 +54,7 @@ class ICEBERG_EXPORT KeyManagementClient {
 
   /// \brief Initialize the client with the catalog properties.
   virtual Status Initialize(
-      const std::unordered_map<std::string, std::string>& properties) {
+      const std::unordered_map<std::string, std::string>& /*properties*/) {
     return {};
   }
 
@@ -72,7 +72,7 @@ class ICEBERG_EXPORT KeyManagementClient {
   virtual bool SupportsKeyGeneration() const { return false; }
 
   /// \brief Generate a new key in the KMS, returned in plain and wrapped form.
-  virtual Result<GeneratedKey> GenerateKey(std::string_view wrapping_key_id) {
+  virtual Result<GeneratedKey> GenerateKey(std::string_view 
/*wrapping_key_id*/) {
     return NotSupported("Key generation is not supported by this KMS client");
   }
 };
diff --git a/src/iceberg/expression/binder.cc b/src/iceberg/expression/binder.cc
index 52dede27..3b3897f4 100644
--- a/src/iceberg/expression/binder.cc
+++ b/src/iceberg/expression/binder.cc
@@ -120,22 +120,22 @@ Result<std::optional<bool>> IsBoundVisitor::Or(const 
std::optional<bool>& left_r
 }
 
 Result<std::optional<bool>> IsBoundVisitor::Predicate(
-    const std::shared_ptr<BoundPredicate>& pred) {
+    const std::shared_ptr<BoundPredicate>& /*pred*/) {
   return true;
 }
 
 Result<std::optional<bool>> IsBoundVisitor::Predicate(
-    const std::shared_ptr<UnboundPredicate>& pred) {
+    const std::shared_ptr<UnboundPredicate>& /*pred*/) {
   return false;
 }
 
 Result<std::optional<bool>> IsBoundVisitor::Aggregate(
-    const std::shared_ptr<BoundAggregate>& aggregate) {
+    const std::shared_ptr<BoundAggregate>& /*aggregate*/) {
   return true;
 }
 
 Result<std::optional<bool>> IsBoundVisitor::Aggregate(
-    const std::shared_ptr<UnboundAggregate>& aggregate) {
+    const std::shared_ptr<UnboundAggregate>& /*aggregate*/) {
   return false;
 }
 
diff --git a/src/iceberg/expression/expression.h 
b/src/iceberg/expression/expression.h
index 43e4a2c1..63dc7ef2 100644
--- a/src/iceberg/expression/expression.h
+++ b/src/iceberg/expression/expression.h
@@ -77,7 +77,7 @@ class ICEBERG_EXPORT Expression : public util::Formattable {
   /// \brief Returns whether this expression will accept the same values as 
another.
   /// \param other another expression
   /// \return true if the expressions are equivalent
-  virtual bool Equals(const Expression& other) const {
+  virtual bool Equals(const Expression& /*other*/) const {
     // only bound predicates can be equivalent
     return false;
   }
diff --git a/src/iceberg/expression/expression_visitor.h 
b/src/iceberg/expression/expression_visitor.h
index 27cfb99c..16c3e362 100644
--- a/src/iceberg/expression/expression_visitor.h
+++ b/src/iceberg/expression/expression_visitor.h
@@ -117,13 +117,13 @@ class ICEBERG_EXPORT BoundVisitor : public 
ExpressionVisitor<R> {
 
   /// \brief Visit an IS_NAN bound expression.
   /// \param expr The bound expression being tested
-  virtual Result<R> IsNaN(const std::shared_ptr<Bound>& expr) {
+  virtual Result<R> IsNaN(const std::shared_ptr<Bound>& /*expr*/) {
     return NotSupported("IsNaN operation is not supported by this visitor");
   }
 
   /// \brief Visit a NOT_NAN bound expression.
   /// \param expr The bound expression being tested
-  virtual Result<R> NotNaN(const std::shared_ptr<Bound>& expr) {
+  virtual Result<R> NotNaN(const std::shared_ptr<Bound>& /*expr*/) {
     return NotSupported("NotNaN operation is not supported by this visitor");
   }
 
diff --git a/src/iceberg/expression/expressions.cc 
b/src/iceberg/expression/expressions.cc
index 4b0e538a..8a4505c1 100644
--- a/src/iceberg/expression/expressions.cc
+++ b/src/iceberg/expression/expressions.cc
@@ -292,7 +292,8 @@ std::shared_ptr<NamedReference> 
Expressions::Ref(std::string name) {
   return ref;
 }
 
-Literal Expressions::Lit(Literal::Value value, std::shared_ptr<PrimitiveType> 
type) {
+Literal Expressions::Lit(Literal::Value /*value*/,
+                         std::shared_ptr<PrimitiveType> /*type*/) {
   throw ExpressionError("Literal creation is not implemented");
 }
 
diff --git a/src/iceberg/expression/literal.cc 
b/src/iceberg/expression/literal.cc
index c8dd74a4..c3891bcd 100644
--- a/src/iceberg/expression/literal.cc
+++ b/src/iceberg/expression/literal.cc
@@ -528,7 +528,7 @@ Result<Literal> LiteralCaster::CastFromBinary(
   switch (target_type->type_id()) {
     case TypeId::kFixed: {
       auto target_fixed_type = 
internal::checked_pointer_cast<FixedType>(target_type);
-      if (binary_val.size() == target_fixed_type->length()) {
+      if (binary_val.size() == 
static_cast<size_t>(target_fixed_type->length())) {
         return Literal::Fixed(std::move(binary_val));
       }
       return InvalidArgument("Failed to cast Binary with length {} to 
Fixed({})",
@@ -802,8 +802,8 @@ bool Literal::IsAboveMax() const { return 
std::holds_alternative<AboveMax>(value
 bool Literal::IsNull() const { return 
std::holds_alternative<std::monostate>(value_); }
 
 bool Literal::IsNaN() const {
-  return std::holds_alternative<float>(value_) && 
std::isnan(std::get<float>(value_)) ||
-         std::holds_alternative<double>(value_) && 
std::isnan(std::get<double>(value_));
+  return (std::holds_alternative<float>(value_) && 
std::isnan(std::get<float>(value_))) ||
+         (std::holds_alternative<double>(value_) && 
std::isnan(std::get<double>(value_)));
 }
 
 // LiteralCaster implementation
diff --git a/src/iceberg/expression/manifest_evaluator.cc 
b/src/iceberg/expression/manifest_evaluator.cc
index bc7d0bfe..3042b523 100644
--- a/src/iceberg/expression/manifest_evaluator.cc
+++ b/src/iceberg/expression/manifest_evaluator.cc
@@ -187,7 +187,8 @@ class ManifestEvalVisitor : public BoundVisitor<bool> {
     return kRowsMightMatch;
   }
 
-  Result<bool> NotEq(const std::shared_ptr<Bound>& expr, const Literal& lit) 
override {
+  Result<bool> NotEq(const std::shared_ptr<Bound>& /*expr*/,
+                     const Literal& /*lit*/) override {
     // because the bounds are not necessarily a min or max value, this cannot 
be answered
     // using them. notEq(col, X) with (X, Y) doesn't guarantee that X is a 
value in col.
     return kRowsMightMatch;
@@ -222,8 +223,8 @@ class ManifestEvalVisitor : public BoundVisitor<bool> {
     return kRowsMightMatch;
   }
 
-  Result<bool> NotIn(const std::shared_ptr<Bound>& expr,
-                     const BoundSetPredicate::LiteralSet& literal_set) 
override {
+  Result<bool> NotIn(const std::shared_ptr<Bound>& /*expr*/,
+                     const BoundSetPredicate::LiteralSet& /*literal_set*/) 
override {
     // because the bounds are not necessarily a min or max value, this cannot 
be answered
     // using them. notIn(col, {X, ...}) with (X, Y) doesn't guarantee that X 
is a value in
     // col.
diff --git a/src/iceberg/expression/projections.cc 
b/src/iceberg/expression/projections.cc
index dd83ef80..e332431b 100644
--- a/src/iceberg/expression/projections.cc
+++ b/src/iceberg/expression/projections.cc
@@ -44,7 +44,7 @@ class ProjectionVisitor : public 
ExpressionVisitor<std::shared_ptr<Expression>>
   Result<std::shared_ptr<Expression>> AlwaysFalse() override { return 
False::Instance(); }
 
   Result<std::shared_ptr<Expression>> Not(
-      const std::shared_ptr<Expression>& child_result) override {
+      const std::shared_ptr<Expression>& /*child_result*/) override {
     return InvalidExpression("Project called on expression with a not");
   }
 
diff --git a/src/iceberg/file_io.h b/src/iceberg/file_io.h
index 4dd96530..99d0588a 100644
--- a/src/iceberg/file_io.h
+++ b/src/iceberg/file_io.h
@@ -165,7 +165,7 @@ class ICEBERG_EXPORT FileIO {
   ///
   /// \param file_location The location of the file to delete.
   /// \return void if the delete succeeded, an error code if the delete failed.
-  virtual Status DeleteFile(const std::string& file_location) {
+  virtual Status DeleteFile(const std::string& /*file_location*/) {
     return NotImplemented("DeleteFile not implemented");
   }
 
diff --git a/src/iceberg/util/executor_util_internal.h 
b/src/iceberg/util/executor_util_internal.h
index f41b8ad3..c6487941 100644
--- a/src/iceberg/util/executor_util_internal.h
+++ b/src/iceberg/util/executor_util_internal.h
@@ -216,9 +216,10 @@ auto ParallelCollect(OptionalExecutor executor, Args&&... 
args) {
                 return {};
               });
             } else {
-              group.Submit([&, item = std::move(item)]() mutable -> Status {
+              group.Submit([&, moved_item = std::move(item)]() mutable -> 
Status {
                 ICEBERG_ASSIGN_OR_RAISE(
-                    value, std::invoke(std::get<I * 2 + 1>(args_tuple), 
std::move(item)));
+                    value,
+                    std::invoke(std::get<I * 2 + 1>(args_tuple), 
std::move(moved_item)));
                 return {};
               });
             }

Reply via email to