Boost logo

Boost Users :

Subject: Re: [Boost-users] [Review] UUID library (mini-)review starts today, November 23rd
From: Daniel Krügler (dsp_at_[hidden])
Date: 2008-12-10 03:31:59


Andy Tompkins wrote:
> On Sat, 6 Dec 2008 15:28:30 -0500, "Scott McMurray"
> <me22.ca+boost_at_[hidden]> said:
>> My understanding is that posix sockets require CHAR_BIT == 8, so
>> outside of DSP chips and other special hardware, that's almost always
>> the case. Considering that UUIDs were originally designed for RPC --
>> typically over sockets -- and that the v1 algorithm is defined using
>> MAC addresses, it's probably a safe assumption.
>
> Thank you. So I think the uuid library will require either that
> CHAR_BIT == 8
> or CHAR_BIT % 8 == 0. That is to say that the platform must have 8 bit
> bytes.

The last condition (CHAR_BIT % 8 == 0) does not prove that the
platform has 8 bit bytes, just consider DSP controllers with
CHAR_BIT = 32 - we have those. I have not completely followed
the discussion, but it is of-course possible to realize effective
8 bit calculations even on those systems with CHAR_BIT > 8 by
effectively using a math with corresponding bit masks hiding
everything beyond the 8 bit limit.

Side note: The C++ is going to introduce non-optional new
character types char16_t and char32_t. But these are not required
to exactly fit into 16 bit or 32 bit, just they are required to be
capable to *represent* corresponding values. This seems quite
similar to the discussion here, if I did not misunderstand it.

Greetings from Bremen,

Daniel Krügler


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net