On Sun, Jan 9, 2011 at 5:37 PM, john skaller
<[email protected]> wrote:
> On 64 bit windows, unsigned int is still 32 bit. Judy requires a full
> size machine word.

Linux too, it's mandated by the SYSV ABI. Oddly enough, this mixed mode works
quite well on x86 due to its CISC nature and historical accident, it's
arithmetic operations default to 32 bit so you get more compact code when
using a 32 bit int, however x86 still has all these wacky indexing modes for
pointers, meaning you rarely actually have to directly manipulate pointers as
if they are numbers. So you can have 32 bit ints and 64 bit pointers while
still having compact code.

> You must not usurp a name as common as "uint".
>
> The correct name to use "would be"
>
> uintptr_t
>
> if only the dang C99 Standard actually mandated it, but it doesn't.

I think it is okay to consider it standard de facto. It was made optional to
allow C compilers on machines that can't manipulate pointers as if they are
numbers, odd tagged memory machines or whatnot. In any case, I have not lost
any sleep over assuming it is available and having autoconf create a conforming
stdint.h if it isn't there.

> Unfortunately, I have to recommend (b). It's unfortunate our standards bodies
> have let us down a bit here, but people like to preserve old code.

I don't think this was about old code, it is about machines that actually don't
have any representation of pointers that can be fit in a word. Using uintptr_t
is fully portable in practice and I encourage its use. (it is a pet peeve of
mine when people don't use it.)

     John

------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
_______________________________________________
Judy-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/judy-devel

Reply via email to