C library typedefs

Programming, for all ages and all languages.
Post Reply
bluecode

C library typedefs

Post 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 :)
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:C library typedefs

Post 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...
Every good solution is obvious once you've found it.
yayyak

Re:C library typedefs

Post 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).
Post Reply