From 014b9fd709db11890e403617930646aed1270cb7 Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Sat, 7 May 2022 17:41:26 +0200 Subject: AK+DHCPClient: Fix false positive gcc 12 warnings The compiler would complain about `__builtin_memcpy` in ByteBuffer::copy writing out of bounds, as it isn't able to deduce the invariant that the inline buffer is only used when the requested size is smaller than the inline capacity. The other change is more bizarre. If the destructor's declaration exists, gcc complains about a `delete` operation causing an out-of-bounds array access. error: array subscript 'DHCPv4Client::__as_base [0]' is partly outside array bounds of 'unsigned char [8]' [-Werror=array-bounds] 14 | ~DHCPv4Client() = default; | ^ This looks like a compiler bug, and I'll report it if I find a suitable reduced reproducer. --- Userland/Services/DHCPClient/DHCPv4Client.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'Userland/Services/DHCPClient') diff --git a/Userland/Services/DHCPClient/DHCPv4Client.h b/Userland/Services/DHCPClient/DHCPv4Client.h index d14deebd16..6e7146d36a 100644 --- a/Userland/Services/DHCPClient/DHCPv4Client.h +++ b/Userland/Services/DHCPClient/DHCPv4Client.h @@ -40,8 +40,6 @@ class DHCPv4Client final : public Core::Object { C_OBJECT(DHCPv4Client) public: - virtual ~DHCPv4Client() override = default; - void dhcp_discover(InterfaceDescriptor const& ifname); void dhcp_request(DHCPv4Transaction& transaction, DHCPv4Packet const& packet); -- cgit v1.2.3