On Fri, May 28, 2004 at 10:12:38PM +0200, Stephane Marchesin wrote:Ian Romanick wrote:
So, for whatever reason, size_t is used in drm.h in several structures that are shared between user and kernel. HOWEVER, xf86drm.h uses int in those places. Is it safe to assume sizeof(int) == sizeof(size_t)?
Well, on ia64, sizeof(size_t)==8, while sizeof(int)==4
Some searching on the net tells me that:
A ``plain'' int object has the natural size suggested by the architecture of the execution environment (large enough to contain any value in the range INT_MIN to INT_MAX as defined in the header <limits.h>).
and:
size_t which is the unsigned integer type of the result of the sizeof operator; and
So if this is correct it looks like:
1) on ia64, the compiler Ian used does not comply to the standard
It was Stephane who had the IA64 compiler. :) The statement about size_t says nothing about the type of the result of sizeof. If sizeof(sizeof()) is 8 and sizeof(size_t) is 8, then that statement is still valid. That is apparently the case on IA64. It's probably also the case on other LP64 platforms.
2) size_t and int differ in signed-ness
That is also true.
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
--
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel