grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/7]: Fix sparc64 setjmp implementation.


From: Isaac Dupree
Subject: Re: [PATCH 1/7]: Fix sparc64 setjmp implementation.
Date: Thu, 5 Mar 2009 08:04:07 -0500
User-agent: KMail/1.10.4 (Linux/2.6.27-11-generic; KDE/4.1.4; x86_64; ; )

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]