Re: Q: void* vs. unsigned long

Martin Mares (mj@ucw.cz)
Tue, 16 Feb 1999 20:02:08 +0100


Hello,

> I'm curious about the mixed use of void* and unsigned long in the kernel to
> represent addresses (as in tqueue.h vs. timer.h). Is it simply a case of
> author preference, or is it subtle semantics for the case where a datam is
> most likely an integer value but _could_ also be a pointer? Or is it more
> complicated? With the future in mind, what is recommended to budding
> kernel hackers?

No C standard defines that a pointer should fit in some integer type,
but the kernel needs to assume that on several places. In such cases, it's
safe to expect that it fits in unsigned long and it does hold on all
current Linux ports.

Have a nice fortnight

-- 
Martin `MJ' Mares   <mj@ucw.cz>   http://atrey.karlin.mff.cuni.cz/~mj/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
"Unexpected ';', expecting ';'."

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/