From cbf9b55cf61d23016e3a5a918c7ac4a8c18faf45 Mon Sep 17 00:00:00 2001 From: Deepak Majeti Date: Mon, 27 May 2024 23:00:36 -0700 Subject: [PATCH] Fix GCC12 return-type warning (#9902) Summary: Fix warnings of type `control reaches end of non-void function [-Wreturn-type]` Pull Request resolved: https://github.com/facebookincubator/velox/pull/9902 Reviewed By: amitkdutta, tanjialiang Differential Revision: D57847046 Pulled By: xiaoxmeng fbshipit-source-id: 2ed27af9027da729bb7a156ed05107fcfbfd3145 --- velox/functions/lib/aggregates/BitwiseAggregateBase.h | 3 +-- velox/functions/prestosql/aggregates/MinMaxAggregates.cpp | 8 +++----- velox/functions/prestosql/aggregates/SumAggregate.cpp | 3 +-- velox/functions/sparksql/aggregates/SumAggregate.cpp | 3 +-- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/velox/functions/lib/aggregates/BitwiseAggregateBase.h b/velox/functions/lib/aggregates/BitwiseAggregateBase.h index 5566680677f0..cb9405d2c3d6 100644 --- a/velox/functions/lib/aggregates/BitwiseAggregateBase.h +++ b/velox/functions/lib/aggregates/BitwiseAggregateBase.h @@ -108,8 +108,7 @@ exec::AggregateRegistrationResult registerBitwise( case TypeKind::BIGINT: return std::make_unique>(resultType); default: - VELOX_CHECK( - false, + VELOX_UNREACHABLE( "Unknown input type for {} aggregation {}", name, inputType->kindName()); diff --git a/velox/functions/prestosql/aggregates/MinMaxAggregates.cpp b/velox/functions/prestosql/aggregates/MinMaxAggregates.cpp index b5b7a88903aa..ecd0219f7f0a 100644 --- a/velox/functions/prestosql/aggregates/MinMaxAggregates.cpp +++ b/velox/functions/prestosql/aggregates/MinMaxAggregates.cpp @@ -971,10 +971,9 @@ exec::AggregateRegistrationResult registerMinMax( if (inputType->isLongDecimal()) { return std::make_unique>(resultType); } - VELOX_UNREACHABLE(); + [[fallthrough]]; default: - VELOX_CHECK( - false, + VELOX_UNREACHABLE( "Unknown input type for {} aggregation {}", name, inputType->kindName()); @@ -1012,8 +1011,7 @@ exec::AggregateRegistrationResult registerMinMax( return std::make_unique( inputType, throwOnNestedNulls); default: - VELOX_CHECK( - false, + VELOX_UNREACHABLE( "Unknown input type for {} aggregation {}", name, inputType->kindName()); diff --git a/velox/functions/prestosql/aggregates/SumAggregate.cpp b/velox/functions/prestosql/aggregates/SumAggregate.cpp index e905f59871c1..0f6278e96a75 100644 --- a/velox/functions/prestosql/aggregates/SumAggregate.cpp +++ b/velox/functions/prestosql/aggregates/SumAggregate.cpp @@ -104,8 +104,7 @@ exec::AggregateRegistrationResult registerSum( return std::make_unique>(resultType); default: - VELOX_CHECK( - false, + VELOX_UNREACHABLE( "Unknown input type for {} aggregation {}", name, inputType->kindName()); diff --git a/velox/functions/sparksql/aggregates/SumAggregate.cpp b/velox/functions/sparksql/aggregates/SumAggregate.cpp index c6da0e51ff31..a0c8fe2c0acb 100644 --- a/velox/functions/sparksql/aggregates/SumAggregate.cpp +++ b/velox/functions/sparksql/aggregates/SumAggregate.cpp @@ -148,8 +148,7 @@ exec::AggregateRegistrationResult registerSum( } [[fallthrough]]; default: - VELOX_CHECK( - false, + VELOX_UNREACHABLE( "Unknown input type for {} aggregation {}", name, inputType->kindName());