Skip to content

Commit

Permalink
gcc: remove -Wdangling-reference workaround (#36452)
Browse files Browse the repository at this point in the history
The false positive warnings have been resolved in current versions of
gcc.

Risk Level: low
Testing: CI

Signed-off-by: Alejandro R. Sedeño <[email protected]>
  • Loading branch information
asedeno authored Oct 4, 2024
1 parent 1173629 commit 9244dc9
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,14 +275,7 @@ void Utility::extractCommonAccessLogProperties(
}

if (stream_info.upstreamInfo().has_value()) {
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdangling-reference"
#endif
const auto& upstream_info = stream_info.upstreamInfo().value().get();
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif
if (upstream_info.upstreamHost() != nullptr) {
Network::Utility::addressToProtobufAddress(
*upstream_info.upstreamHost()->address(),
Expand Down
8 changes: 0 additions & 8 deletions source/extensions/common/dubbo/hessian2_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,7 @@
#include "envoy/buffer/buffer.h"

#include "absl/strings/string_view.h"

#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdangling-reference"
#endif
#include "hessian2/basic_codec/object_codec.hpp"
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif
#include "hessian2/codec.hpp"
#include "hessian2/object.hpp"
#include "hessian2/reader.hpp"
Expand Down
9 changes: 0 additions & 9 deletions source/extensions/filters/network/dubbo_proxy/hessian_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,7 @@
#include "envoy/buffer/buffer.h"

#include "absl/strings/string_view.h"

#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdangling-reference"
#endif
#include "hessian2/basic_codec/object_codec.hpp"
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif

#include "hessian2/codec.hpp"
#include "hessian2/object.hpp"
#include "hessian2/reader.hpp"
Expand Down
7 changes: 0 additions & 7 deletions source/extensions/health_checkers/grpc/health_checker_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -196,15 +196,8 @@ void GrpcHealthCheckerImpl::GrpcActiveHealthCheckSession::onInterval() {
request_encoder_ = &client_->newStream(*this);
request_encoder_->getStream().addCallbacks(*this);

#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdangling-reference"
#endif
const std::string& authority =
getHostname(host_, parent_.authority_value_, parent_.cluster_.info());
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif
auto headers_message =
Grpc::Common::prepareHeaders(authority, parent_.service_method_.service()->full_name(),
parent_.service_method_.name(), absl::nullopt);
Expand Down
7 changes: 0 additions & 7 deletions source/extensions/health_checkers/http/health_checker_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,7 @@ class HttpHealthCheckerImpl : public HealthCheckerImplBase {
Http::CodecClientPtr client_;
Http::ResponseHeaderMapPtr response_headers_;
Buffer::InstancePtr response_body_;
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdangling-reference"
#endif
const std::string& hostname_;
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif
Network::ConnectionInfoProviderSharedPtr local_connection_info_provider_;
// Keep small members (bools and enums) at the end of class, to reduce alignment overhead.
const Http::Protocol protocol_;
Expand Down
7 changes: 0 additions & 7 deletions source/extensions/health_checkers/thrift/thrift.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,7 @@ class ThriftHealthChecker : public Upstream::HealthCheckerImplBase {

private:
ThriftHealthChecker& parent_;
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdangling-reference"
#endif
const std::string& hostname_;
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif
ClientPtr client_;
bool expect_close_{};
};
Expand Down

0 comments on commit 9244dc9

Please sign in to comment.