David Miller wrote:
> "unsigned long" is always safe because it is going to be
> the largest natural word size on the machine, at least
> as large as a pointer will be.

er... C standard doesn't guarantee this, and I think that Windows in fact has 
32-bit longs on machines with 64-bit pointers

> We've been using "unsigned long" for storing virtual addresses in the
> Linux kernel for 10+ years and it works just fine.  :-)

and Linux kernel uses GCC compiler in precise ways

I believe that ptrdiff_t is the proper standardized type for an integer the 
size of a pointer.  except... it's always signed :-)

Can you just use pointer types and pointer arithmetic?

also, standards aside, a common way to get such a type, is "configure" script 
testing various possibilities like "unsigned long" and "unsigned long long" 
and seeing which one is the right size for the target architecture. (not sure 
if that works when cross-compiling though)

-Isaac



_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to