Skip to content

Commit

Permalink
Silence build warnings.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 658101862
  • Loading branch information
CEL Dev Team authored and copybara-github committed Jul 31, 2024
1 parent 588cfad commit df7cc68
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 4 deletions.
9 changes: 9 additions & 0 deletions common/legacy_value.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@
#define CEL_ATTRIBUTE_DEFAULT_VISIBILITY
#endif

#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wreturn-type-c-linkage"
#endif

namespace cel {

namespace {
Expand Down Expand Up @@ -1652,3 +1657,7 @@ bool TestOnly_IsLegacyMapBuilder(const MapValueBuilder& builder) {
} // namespace interop_internal

} // namespace cel

#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
9 changes: 9 additions & 0 deletions common/map_type_reflector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,11 @@ ABSL_CONST_INIT struct {
LegacyTypeReflector_NewMapValueBuilder new_map_value_builder = nullptr;
} legacy_type_reflector_vtable;

#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wreturn-type-c-linkage"
#endif

#if ABSL_HAVE_ATTRIBUTE_WEAK
extern "C" ABSL_ATTRIBUTE_WEAK absl::StatusOr<Unique<MapValueBuilder>>
cel_common_internal_LegacyTypeReflector_NewMapValueBuilder(
Expand All @@ -643,6 +648,10 @@ void InitializeLegacyTypeReflector() {
});
}

#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

} // namespace

absl::StatusOr<Unique<MapValueBuilder>> TypeReflector::NewMapValueBuilder(
Expand Down
9 changes: 9 additions & 0 deletions common/values/legacy_list_value.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
#include "internal/dynamic_loader.h" // IWYU pragma: keep
#include "internal/status_macros.h"

#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wreturn-type-c-linkage"
#endif

namespace cel::common_internal {

namespace {
Expand Down Expand Up @@ -247,3 +252,7 @@ absl::Status LegacyListValue::Contains(ValueManager& value_manager,
}

} // namespace cel::common_internal

#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
9 changes: 9 additions & 0 deletions common/values/legacy_map_value.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
#include "internal/dynamic_loader.h" // IWYU pragma: keep
#include "internal/status_macros.h"

#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wreturn-type-c-linkage"
#endif

namespace cel::common_internal {

namespace {
Expand Down Expand Up @@ -267,3 +272,7 @@ absl::Status LegacyMapValue::Equal(ValueManager& value_manager,
}

} // namespace cel::common_internal

#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
9 changes: 9 additions & 0 deletions common/values/legacy_struct_value.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
#include "internal/status_macros.h"
#include "runtime/runtime_options.h"

#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wreturn-type-c-linkage"
#endif

namespace cel::common_internal {

namespace {
Expand Down Expand Up @@ -318,3 +323,7 @@ absl::StatusOr<int> LegacyStructValue::Qualify(
}

} // namespace cel::common_internal

#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
2 changes: 1 addition & 1 deletion eval/eval/cel_expression_flat_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class CelExpressionRecursiveImpl : public CelExpression {
CelExpressionRecursiveImpl& operator=(const CelExpressionRecursiveImpl&) =
delete;
CelExpressionRecursiveImpl(CelExpressionRecursiveImpl&&) = default;
CelExpressionRecursiveImpl& operator=(CelExpressionRecursiveImpl&&) = default;
CelExpressionRecursiveImpl& operator=(CelExpressionRecursiveImpl&&) = delete;

// Implement CelExpression.
std::unique_ptr<CelEvaluationState> InitializeState(
Expand Down
3 changes: 1 addition & 2 deletions extensions/protobuf/type_reflector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,7 @@ class ProtoStructValueBuilder final : public StructValueBuilder {
value_factory_);
CEL_RETURN_IF_ERROR(list_value->ForEach(
value_manager,
[this, field, accessor,
&value_manager](const Value& element) -> absl::StatusOr<bool> {
[this, field, accessor](const Value& element) -> absl::StatusOr<bool> {
CEL_RETURN_IF_ERROR((*accessor)(type_reflector_.descriptor_pool(),
type_reflector_.message_factory(),
reflection_, message_, field,
Expand Down
2 changes: 1 addition & 1 deletion internal/new.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace cel::internal {

namespace {

[[noreturn]] void ThrowStdBadAlloc() {
[[noreturn, maybe_unused]] void ThrowStdBadAlloc() {
#ifdef ABSL_HAVE_EXCEPTIONS
throw std::bad_alloc();
#else
Expand Down

0 comments on commit df7cc68

Please # to comment.