Skip to content

Commit

Permalink
Pull request 599: Fix building with GCC
Browse files Browse the repository at this point in the history
Merge in ADGUARD-CORE-LIBS/dns-libs from fix/gcc to master

Squashed commit of the following:

commit 92983a79cf260f97416cbde91b4ca41f59275429
Author: Sergey Fionov <[email protected]>
Date:   Wed Nov 29 15:25:17 2023 +0200

    Fix building with GCC
  • Loading branch information
sfionov committed Dec 1, 2023
1 parent e0b946b commit ba863af
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
6 changes: 5 additions & 1 deletion common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ target_link_libraries(dnslibs_common magic_enum::magic_enum native_libs_common::
if (NOT MSVC)
target_compile_options(dnslibs_common PRIVATE -Wall -Wextra)
target_compile_options(dnslibs_common PUBLIC -Wno-format-nonliteral) # for fmt's chrono build
target_compile_options(dnslibs_common PUBLIC -Wno-unknown-warning-option -Wno-deprecated-experimental-coroutine)
if (CMAKE_C_COMPILER_ID MATCHES ".*Clang")
target_compile_options(dnslibs_common PUBLIC -Wno-unknown-warning-option -Wno-deprecated-experimental-coroutine)
else()
target_compile_options(dnslibs_common PUBLIC -Wno-return-type -Wno-missing-field-initializers -Wno-redundant-move -Wno-array-bounds -Wno-changes-meaning)
endif()
target_compile_options(dnslibs_common PRIVATE -fno-exceptions)
else()
target_compile_options(dnslibs_common PRIVATE /W3)
Expand Down
1 change: 1 addition & 0 deletions net/tcp_dns_buffer.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "dns/net/tcp_dns_buffer.h"
#include <cassert>
#include <cstring>
#include <utility>

#ifndef _WIN32
#include <netinet/in.h>
Expand Down
2 changes: 1 addition & 1 deletion proxy/response_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class ResponseHelpers {
} else { // hosts-style IP rule
return create_response_with_ips(request, settings, rules);
}
ldns_pkt *result;
ldns_pkt *result = nullptr;
switch (mode) {
case DnsProxyBlockingMode::REFUSED:
result = create_refused_response(request, settings);
Expand Down
2 changes: 1 addition & 1 deletion proxy/test/big_dns_packet.inc
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@ static constexpr uint8_t BIG_PACKET[] = "\x3d\x69\x81\x80\x00\x01\x00\x11\x00\x0
"\x1e\xc4\x21\x00\x01\x00\x01\x00\x02\x38\xbe\x00\x04\xc1\x00\x0e" \
"\x81\xc3\x81\x00\x01\x00\x01\x00\x02\x38\xbe\x00\x04\xc7\x07\x53" \
"\x2a\xc3\xd1\x00\x01\x00\x01\x00\x01\xe1\x34\x00\x04\xca\x0c\x1b" \
"\x21\x00\x00\x29\x04\xd0\x00\x00\x00\x00\x00\x00";
"\x21\x00\x00\x29\x04\xd0\x00\x00\x00\x00\x00\x00";
4 changes: 1 addition & 3 deletions upstream/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,7 @@ class ConnectionPoolBase : public std::enable_shared_from_this<ConnectionPoolBas
tracelog(m_log, "{} Created", m_address_str);
};
virtual ~ConnectionPoolBase() {
if (auto *upstream = m_upstream.lock().get()) {
tracelog(m_log, "{} Destroyed", m_address_str);
}
tracelog(m_log, "{} Destroyed", m_address_str);
}

/**
Expand Down

0 comments on commit ba863af

Please sign in to comment.