Page 1 of 1

C library typedefs

Posted: Mon Jul 24, 2006 11:14 am
by bluecode
hi,

I was wondering if there is a standard C typedef for the size of a register (eg. 32bit on x86 and 64bit on x86-64)? I mean, then I don't have to define my own types in my kernel...

thanks in advance :)

Re:C library typedefs

Posted: Mon Jul 24, 2006 9:59 pm
by Solar
No, there isn't.

intptr_t comes quite close (an integer type you can cast a pointer to and back from with no loss of information), but since it is possible for a platform to have different sizes for data and address registers, that needn't necessarily be the size of a data register...

Re:C library typedefs

Posted: Mon Jul 24, 2006 10:15 pm
by yayyak
*Stabs darkness*

My guess is that it is because C does not operate on registers. Indeed, the C program may be operating on a computer without registers (stupid, but possible none the less).