A question for you all: size_t or unsigned int

Paul Harris paulharris at computer.org
Thu Nov 13 12:02:47 UTC 2008


2008/11/13 martin f krafft <madduck at debian.org>

> also sprach Paul Harris <paulharris at computer.org> [2008.11.13.1254 +0100]:
> > does anyone know what the "standard" policy is on this?  from what I can
> > tell, size_t will allow you to store the largest integer number on that
>
> *unsigned*
>
> > platform (eg max memory address etc) whereas unsigned int is the most
> > efficient integer size...
>
> int is defined to be 32bits, I think. So the question is really: is
> max(size_t) platform dependent or not. If it is, then we ought to
> avoid that, I think. If it isn't, then it's just the same as
> unsigned int. Thus, unsigned int, might be the better choice.
>

it is platform dependent, but i read on the internet (therefore it must be
true) that it was designed that way so its more portable.

an 8 bit platform will give you a small size_t since it can't address large
amounts of memory anyway...

that way, the same code will "scale up" from an 8 bit microcpu up to the 64
bit gorillas

no?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.alioth.debian.org/pipermail/libkdtree-devel/attachments/20081113/33b1d2bc/attachment.htm 


More information about the libkdtree-devel mailing list