On Wed, 18 May 2005, Michael S. Tsirkin wrote:

Quoting r. Roland Dreier <[EMAIL PROTECTED]>:
Subject: Re: [PATCH][0/19] kDAPL: More cleanups in dat.h

    James> DAPL was using the uintptr_t type when casting to an
    James> integer type from a pointer type. Is there another type
    James> that the kernel uses for this purpose? I know that long is
    James> typically used, but according to Harbison and Stelle this
    James> is not guaranteed to be correct.

AFAIK that appeared in the C99 standard. You need #include <stdint.h> to get these types though.

The problem is stdint.h is a user level include file. The linux kernel sources don't contain a common definition of uintptr_t. There is a #define for uintptr_t in drivers/net/sk98lin/h/skdrv1st.h in 2.6.11, but obviously that was not intended for general use.


I'll go with unsigned long.

The assumption that pointers can be safely cast to and from unsigned
long is used all over the Linux kernel.  In other words, use "unsigned
long" instead of "uintptr_t".

- R.

Right. Its OK because kernel requires gcc.

--
MST - Michael S. Tsirkin

_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to