10 Dec 09:31
Re: [Review] UUID library (mini-)review starts today, November 23rd
Daniel Krügler <dsp <at> bdal.de>
2008-12-10 08:31:59 GMT
2008-12-10 08:31:59 GMT
Andy Tompkins wrote: > On Sat, 6 Dec 2008 15:28:30 -0500, "Scott McMurray" > <me22.ca+boost <at> gmail.com> 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
RSS Feed