On Tue, Mar 04, 2003 at 01:27:28PM +0000, Alan Cox wrote:
> On Tue, 2003-03-04 at 08:22, Philip Brown wrote:
> > "unsigned long" is semi-unspecified, but is reasonably assumed to be
> > a 32-bit quantity.
> 
> On all 64bit bit platforms I have met unsigned long is a 64bit quantity.
> In fact I can't think of a single exception

Well then, obviously, you dont use solaris :-)

#include <stdio.h>

main()
{
        printf("Size of unsigned long is %d\n",sizeof(unsigned long));
        printf("Size of long long is %d\n",sizeof(long long));
}

sparc$ ./t   [compiled with gcc 2.95.2]
Size of unsigned long is 4
Size of long long is 8
sparc$ isalist
sparcv9+vis sparcv9 sparcv8plus+vis sparcv8plus sparcv8 sparcv8-fsmuld
sparcv7 sparc
[that confirms the sparc is running with a 64bit kernel]

If you want to assume that is a 64bit long value, you should be
using u_int64_t, or better yet, uint64_t

Speaking of which, there is "u_int32_t" in the bsd drm kernel stuff.
Technically, it should be uint32_t, which according to the comments in
sys/types.h here, is allegedly part of the ANSI C draft standard,
ISO/IEC 9899:1990
uint32_t appears to be present on solaris, freebsd, and linux



FYI, I'm developing on solaris x86.
Which also keeps the same type for "unsigned long" vs "long long".
Consistency across architectures is a good thing.




-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger 
for complex code. Debugging C/C++ programs can leave you feeling lost and 
disoriented. TotalView can help you find your way. Available on major UNIX 
and Linux platforms. Try it free. www.etnus.com
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to