[C] u_int vs u_int32_t

Programming, for all ages and all languages.
Post Reply
User avatar
narke
Member
Member
Posts: 119
Joined: Wed Dec 26, 2007 3:37 am
Location: France

[C] u_int vs u_int32_t

Post by narke »

Hello,

There are two type definition include files <sys/types.h> (u_int, u_char, u_long) and <stdint.h> (u_int8_t, u_int16_t, u_int32_t...).

What are the differencies between these two? Is it important to make a difference between u_int (32 bits) and u_int32_t which is 32 bits also?

Thanks.
OS for PowerPC Macs: https://github.com/narke/Einherjar
Operating system: colorForth computing environment for x86.: https://github.com/narke/Roentgenium
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: [C] u_int vs u_int32_t

Post by Combuster »

The former is not defined as a specific width, while the latter is courtesy of the C99 standard. That means that all correct (cough msvc) implementations support the latter, while the former may differ in implementation and may not be present at all on non-posix systems.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
narke
Member
Member
Posts: 119
Joined: Wed Dec 26, 2007 3:37 am
Location: France

Re: [C] u_int vs u_int32_t

Post by narke »

That's clear now, thank you.
OS for PowerPC Macs: https://github.com/narke/Einherjar
Operating system: colorForth computing environment for x86.: https://github.com/narke/Roentgenium
Post Reply