BIND 10 #1754: small issues in LabelSequence

BIND 10 Development do-not-reply at isc.org
Sun Mar 4 10:30:31 UTC 2012


#1754: small issues in LabelSequence
-------------------------------------+-------------------------------------
                   Reporter:         |                 Owner:  UnAssigned
  jinmei                             |                Status:  new
                       Type:         |             Milestone:  Next-Sprint-
  defect                             |  Proposed
                   Priority:  major  |            Resolution:
                  Component:         |             Sensitive:  0
  libdns++                           |           Sub-Project:  DNS
                   Keywords:         |  Estimated Difficulty:  0
            Defect Severity:  N/A    |           Total Hours:  0
Feature Depending on Ticket:         |
        Add Hours to Ticket:  0      |
                  Internal?:  0      |
-------------------------------------+-------------------------------------

Comment (by vorner):

 Hello

 Replying to [ticket:1754 jinmei]:
 > - Also, strncasecmp() is not in the C++ standard library and it's less
 >   portable.  And, while it happens to be okay today, I'm afraid it's a
 >   bit fragile to assume the label length field can be compared as a
 >   case insensitive value.

 Hmm, interesting point. I think we could create two names that would not
 be equal because of different lengths of the labels (but the whole length
 being equal), however this would compare them as equal.

 > - Maybe pedantic, but I'm afraid using char* is not technically
 >   correct because size of char may not necessarily be 8-bit (and with
 >   this class we'd use the pair of char* + its "size" as a 8-bit
 >   wire-format sequence.
 >
 > (As a hindsight using std::string (which is basic_string<char>) as the
 > internal representation of Name was also a bad choice, and I've been
 > wanting to fix it but missing the chance.  Maybe we should clarify
 > that, e.g., by changing to basic_string<uint8_t> at this opportunity).

 I'd like to point out that the standard guarantees that sizeof(char) == 1.
 That is, it doesn't have to be 8 bit, because one byte could be 7 or 9 or
 something. But in that case, you won't have uint8_t anyway (the existence
 of fixed-width types is optional), so we wouldn't work anyway. The only
 thing I'd worry is that char might be signed, in which case using it as
 the length of sequence might be problematic.

-- 
Ticket URL: <http://bind10.isc.org/ticket/1754#comment:1>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list