Opened 7 years ago

Closed 5 years ago

#2466 closed defect (wontfix)

define public static class const integral members explicitly

Reported by: jinmei Owned by:
Priority: medium Milestone: Remaining BIND10 tickets
Component: Unclassified Version: bind10-old
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DNS Feature Depending on Ticket:
Estimated Difficulty: 3 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no

Description (last modified by jinmei)

See http://bind10.isc.org/ticket/2371#comment:19

In summary, if we define things like this

// in foo.h
class Foo {
public:
    static const int foo_const = 1;
};

we should add its definition in the corresponding .cc:

// in foo.cc
const int foo_const; // no need for initialization; it's in the declaration

Note that all of "public, static, const, and integral" matter.

And we should remove some workaround we did in tests, such as that for
Name::MAX_WIRE in name_unittest.

From a quick grep, the candidate constants are as follows:

bin/dhcp6/dhcp6_srv.h:    static const size_t MIN_MAC_LEN = 6;
lib/bench/benchmark.h:    static const int TIME_FAILURE = -1;
lib/bench/benchmark.h:    static const int ITERATION_FAILURE = -1;
lib/datasrc/memory/zone_data.h:    static const ZoneNode::Flags WILDCARD_NODE = ZoneNode::FLAG_USER2;
lib/dhcp/duid.h:    static const size_t MAX_DUID_LEN = 128;
lib/dhcp/iface_mgr.h:    static const unsigned int MAX_MAC_LEN = 20;
lib/dhcp/iface_mgr.h:    static const uint32_t RCVBUFSIZE = 1500;
lib/dhcp/iface_mgr.h:    static const int INVALID_SOCKET = -1;
lib/dhcp/option6_iaaddr.h:    static const size_t OPTION6_IAADDR_LEN = 24;
lib/dhcp/option_data_types.h:    static const bool valid = false;
lib/dhcp/option_data_types.h:    static const int len = 0;
lib/dhcp/option_data_types.h:    static const bool valid = true;
lib/dhcp/option_data_types.h:    static const int len = 1;
lib/dhcp/option_data_types.h:    static const bool valid = true;
lib/dhcp/option_data_types.h:    static const int len = 2;
lib/dhcp/option_data_types.h:    static const bool valid = true;
lib/dhcp/option_data_types.h:    static const int len = 4;
lib/dhcp/option_data_types.h:    static const bool valid = true;
lib/dhcp/option_data_types.h:    static const int len = 1;
lib/dhcp/option_data_types.h:    static const bool valid = true;
lib/dhcp/option_data_types.h:    static const int len = 2;
lib/dhcp/option_data_types.h:    static const bool valid = true;
lib/dhcp/option_data_types.h:    static const int len = 4;
lib/dns/edns.h:    static const uint8_t SUPPORTED_VERSION = 0;
lib/dns/labelsequence.h:    static const size_t MAX_SERIALIZED_LENGTH =
lib/dns/message.h:    static const uint16_t DEFAULT_MAX_UDPSIZE = 512;
lib/dns/message.h:    static const uint16_t DEFAULT_MAX_EDNS0_UDPSIZE = 4096;
lib/dns/name.h:    static const size_t MAX_WIRE = 255;
lib/dns/name.h:    static const size_t MAX_LABELS = 128;
lib/dns/name.h:    static const size_t MAX_LABELLEN = 63;
lib/dns/name.h:    static const uint16_t MAX_COMPRESS_POINTER = 0x3fff;
lib/dns/name.h:    static const uint16_t COMPRESS_POINTER_MARK8 = 0xc0;
lib/dns/name.h:    static const uint16_t COMPRESS_POINTER_MARK16 = 0xc000;
lib/dns/tsigrecord.h:    static const uint32_t TSIG_TTL = 0;
lib/log/logger.h:    static const size_t MAX_LOGGER_NAME_SIZE = 31;
lib/log/message_initializer.h:    static const size_t MAX_MESSAGE_ARRAYS = 256;

Subtickets

Change History (7)

comment:1 Changed 7 years ago by jinmei

  • Description modified (diff)

comment:2 follow-up: Changed 7 years ago by jwright

  • Milestone New Tasks deleted
  • Type changed from defect to task

comment:3 in reply to: ↑ 2 ; follow-up: Changed 7 years ago by jinmei

Replying to jwright:

Why did you change it from defect? I believe it's pretty clear it's a kind of bug
(= defect).

comment:4 in reply to: ↑ 3 Changed 7 years ago by jinmei

Replying to jinmei:

Replying to jwright:

Why did you change it from defect? I believe it's pretty clear it's a kind of bug
(= defect).

No response, so I'm changing it back to defect. Having "defect"
ticket in that category is important (at least to me) to suggest
tickets for future sprints.

Jeff: if you change the type of the ticket, especially from defect,
please leave comments why you think the new type is appropriate, not
just making the change.

comment:5 Changed 7 years ago by jinmei

  • Type changed from task to defect

comment:6 Changed 6 years ago by tomek

  • Milestone set to Remaining BIND10 tickets

comment:7 Changed 5 years ago by tomek

  • Resolution set to wontfix
  • Status changed from new to closed
  • Version set to old-bind10

This issue is related to bind10 code that is no longer part of Kea.

If you are interested in BIND10/Bundy framework or its DNS components,
please check http://bundy-dns.de.

Closing ticket.

Note: See TracTickets for help on using tickets.