From b4ca213bb863c81575edd83eebb2511f5839ff89 Mon Sep 17 00:00:00 2001 From: Andrei Pavel Date: Thu, 23 Oct 2025 14:35:15 +0300 Subject: [PATCH] [#4100] Fix compatibility with LLVM libc++ 21 --- src/bin/d2/d2_queue_mgr.h | 18 +++++++++--------- src/hooks/dhcp/radius/radius_accounting.h | 22 +++++++++++----------- src/lib/asiodns/io_fetch.h | 2 +- src/lib/cryptolink/cryptolink.h | 4 ++-- src/lib/d2srv/dns_client.h | 14 +++++++------- src/lib/d2srv/nc_trans.cc | 5 ++--- src/lib/dhcp_ddns/ncr_io.h | 12 ++++++------ src/lib/dhcpsrv/host.h | 14 +++++++------- src/lib/dhcpsrv/lease.h | 6 +++--- 9 files changed, 48 insertions(+), 49 deletions(-) diff --git a/src/bin/d2/d2_queue_mgr.h b/src/bin/d2/d2_queue_mgr.h index b201446c4d..4c730b83b1 100644 --- a/src/bin/d2/d2_queue_mgr.h +++ b/src/bin/d2/d2_queue_mgr.h @@ -1,4 +1,4 @@ -// Copyright (C) 2013-2024 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2013-2025 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -135,14 +135,14 @@ public: static const size_t MAX_QUEUE_DEFAULT = 1024; /// @brief Defines the list of possible states for D2QueueMgr. - enum State { - NOT_INITTED, - INITTED, - RUNNING, - STOPPING, - STOPPED_QUEUE_FULL, - STOPPED_RECV_ERROR, - STOPPED, + enum State : int { + NOT_INITTED = 0, + INITTED = 1, + RUNNING = 2, + STOPPING = 3, + STOPPED_QUEUE_FULL = 4, + STOPPED_RECV_ERROR = 5, + STOPPED = 6, }; /// @brief Constructor diff --git a/src/hooks/dhcp/radius/radius_accounting.h b/src/hooks/dhcp/radius/radius_accounting.h index aeb9b973cb..52a0568429 100644 --- a/src/hooks/dhcp/radius/radius_accounting.h +++ b/src/hooks/dhcp/radius/radius_accounting.h @@ -22,17 +22,17 @@ namespace isc { namespace radius { /// @brief Type of accounting events. -typedef enum { - EVENT_CREATE, //< A new lease was created (leaseX_select hooks). - EVENT_RENEW, //< A lease was renewed (leaseX_renew hooks). - EVENT_REBIND, //< A lease was rebound (lease6_rebind hook). - EVENT_EXPIRE, //< A lease was expired (leaseX_expire hooks). - EVENT_RELEASE, //< A lease was released (leaseX_release hooks). - EVENT_DECLINE, //< A lease was declined (leaseX_decline hooks). - EVENT_ADD, //< A command added a lease (command_processed hook). - EVENT_UPDATE, //< A command updated a lease (command_processed hook). - EVENT_DEL //< A command deleted a lease (command_processed hook). -} Event; +enum Event : int { + EVENT_CREATE = 0, //< A new lease was created (leaseX_select hooks). + EVENT_RENEW = 1, //< A lease was renewed (leaseX_renew hooks). + EVENT_REBIND = 2, //< A lease was rebound (lease6_rebind hook). + EVENT_EXPIRE = 3, //< A lease was expired (leaseX_expire hooks). + EVENT_RELEASE = 4, //< A lease was released (leaseX_release hooks). + EVENT_DECLINE = 5, //< A lease was declined (leaseX_decline hooks). + EVENT_ADD = 6, //< A command added a lease (command_processed hook). + EVENT_UPDATE = 7, //< A command updated a lease (command_processed hook). + EVENT_DEL = 8, //< A command deleted a lease (command_processed hook). +}; /// @brief Translate an event to text. /// diff --git a/src/lib/asiodns/io_fetch.h b/src/lib/asiodns/io_fetch.h index 3053cc2e0a..8bdda974e8 100644 --- a/src/lib/asiodns/io_fetch.h +++ b/src/lib/asiodns/io_fetch.h @@ -56,7 +56,7 @@ public: /// @note that this applies to the status of I/Os in the fetch - a fetch that /// resulted in a packet being received from the server is a SUCCESS, even if /// the contents of the packet indicate that some error occurred. - enum Result { + enum Result : int { SUCCESS = 0, // Success, fetch completed TIME_OUT = 1, // Failure, fetch timed out STOPPED = 2, // Control code, fetch has been stopped diff --git a/src/lib/cryptolink/cryptolink.h b/src/lib/cryptolink/cryptolink.h index 7c2f596978..6dd375a258 100644 --- a/src/lib/cryptolink/cryptolink.h +++ b/src/lib/cryptolink/cryptolink.h @@ -1,4 +1,4 @@ -// Copyright (C) 2011-2024 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2011-2025 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -20,7 +20,7 @@ namespace isc { namespace cryptolink { /// @brief Hash algorithm identifiers. -enum HashAlgorithm { +enum HashAlgorithm : int { UNKNOWN_HASH = 0, // This value can be used in conversion // functions, to be returned when the // input is unknown (but a value MUST be diff --git a/src/lib/d2srv/dns_client.h b/src/lib/d2srv/dns_client.h index 831a233683..cf2f60f4ac 100644 --- a/src/lib/d2srv/dns_client.h +++ b/src/lib/d2srv/dns_client.h @@ -1,4 +1,4 @@ -// Copyright (C) 2013-2024 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2013-2025 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -55,12 +55,12 @@ public: }; /// @brief A status code of the DNSClient. - enum Status { - SUCCESS, ///< Response received and is ok. - TIMEOUT, ///< No response, timeout. - IO_STOPPED, ///< IO was stopped. - INVALID_RESPONSE, ///< Response received but invalid. - OTHER ///< Other, unclassified error. + enum Status : int { + SUCCESS = 0, ///< Response received and is ok. + TIMEOUT = 1, ///< No response, timeout. + IO_STOPPED = 2, ///< IO was stopped. + INVALID_RESPONSE = 3, ///< Response received but invalid. + OTHER = 4, ///< Other, unclassified error. }; /// @brief Callback for the @c DNSClient class. diff --git a/src/lib/d2srv/nc_trans.cc b/src/lib/d2srv/nc_trans.cc index 4fd822e1b6..434a39bd5f 100644 --- a/src/lib/d2srv/nc_trans.cc +++ b/src/lib/d2srv/nc_trans.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2013-2024 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2013-2025 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -158,8 +158,7 @@ NameChangeTransaction::responseString() const { stream << "OTHER"; break; default: - stream << "UNKNOWN(" - << static_cast(getDnsUpdateStatus()) << ")"; + stream << "UNKNOWN(" << getDnsUpdateStatus() << ")"; break; } diff --git a/src/lib/dhcp_ddns/ncr_io.h b/src/lib/dhcp_ddns/ncr_io.h index 8bde34bd13..f759d4332b 100644 --- a/src/lib/dhcp_ddns/ncr_io.h +++ b/src/lib/dhcp_ddns/ncr_io.h @@ -1,4 +1,4 @@ -// Copyright (C) 2013-2024 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2013-2025 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -475,11 +475,11 @@ public: static const size_t MAX_QUEUE_DEFAULT = 1024; /// @brief Defines the outcome of an asynchronous NCR send. - enum Result { - SUCCESS, - TIME_OUT, - STOPPED, - ERROR + enum Result : int { + SUCCESS = 0, + TIME_OUT = 1, + STOPPED = 2, + ERROR = 3, }; /// @brief Abstract class for defining application layer send callbacks. diff --git a/src/lib/dhcpsrv/host.h b/src/lib/dhcpsrv/host.h index 13c98ff364..620afe1391 100644 --- a/src/lib/dhcpsrv/host.h +++ b/src/lib/dhcpsrv/host.h @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2024 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2014-2025 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -334,12 +334,12 @@ public: /// - DUID (DHCPv4 and DHCPv6) (identifier name: "duid"), /// - circuit identifier (DHCPv4) (identifier name: "circuit-id"), /// - client identifier (DHCPv4) (identifier name: "client-id") - enum IdentifierType { - IDENT_HWADDR, - IDENT_DUID, - IDENT_CIRCUIT_ID, - IDENT_CLIENT_ID, - IDENT_FLEX, ///< Flexible host identifier. + enum IdentifierType : int { + IDENT_HWADDR = 0, + IDENT_DUID = 1, + IDENT_CIRCUIT_ID = 2, + IDENT_CLIENT_ID = 3, + IDENT_FLEX = 4, ///< Flexible host identifier. }; /// @brief Constant pointing to the last identifier of the diff --git a/src/lib/dhcpsrv/lease.h b/src/lib/dhcpsrv/lease.h index 479f1c5e99..9618fd5ee8 100644 --- a/src/lib/dhcpsrv/lease.h +++ b/src/lib/dhcpsrv/lease.h @@ -43,12 +43,12 @@ struct Lease : public isc::data::UserContext, public isc::data::CfgToElement { static std::string lifetimeToText(uint32_t lifetime); /// @brief Type of lease or pool - typedef enum { + enum Type : int { TYPE_NA = 0, ///< the lease contains non-temporary IPv6 address TYPE_TA = 1, ///< the lease contains temporary IPv6 address TYPE_PD = 2, ///< the lease contains IPv6 prefix (for prefix delegation) - TYPE_V4 = 3 ///< IPv4 lease - } Type; + TYPE_V4 = 3, ///< IPv4 lease + }; /// @brief returns text representation of a lease type /// @param type lease or pool type to be converted -- 2.47.3