[snips]
If it doesn't exist, it's because the implementation doesn't have a
predefined 32-bit unsigned type.
Making the use of the type effectively impossible, as you can no long
expect your code to compile, on a conforming compiler, except by accident.
Not a great leap forward for C portability.
If you're writing code intended to be maximally portable, then you
don't want or need a type that's exactly 32 bits.
Don't _need_ one, perhaps. Want is another matter. For example, take a
chess program; it would be very nice to specify an 8-bit type for some
purposes, a 32-bit type for others and a 64-bit for some other purposes.
You don't *need* exact-sized types, of course. If char, int and long are
all 32 bits, you may end up wasting a good whack of space in storing
transition tables and the like but the program will still work... it's
just rather likely to work somewhat less efficiently as the storage
overhead skyrockets.
Now if that code could actually rely upon the new int types existing, then
it could opt to use them, with the realization that there will be, on some
systems, some overhead in using some of the types, but trading that off
against the inefficiencies of massively increased storage requirements
(or, worse, massively reducing the amount of effective storage used).
Can't do it, though, because those types don't exist. Or, rather, they
do, for compiler X but not Y. Maybe. If it's a Thursday and sufficient
dead chickens have been waved.
The give you *names* for types of specified widths. (That's all
typedefs do.)
Yeah, and you can't rely on 'em, so you have to get all intimate with the
implementation anyways so your code gives up any hope of being portable so
you may as well use the types which _do_ exist. Again, these things buy
nothing.
Or you can write code that has requirements that can be met on some,
but not all, implementations, and you can use things like int32_t both
to meet those requirements where it's possible, and to indicate (by a
compilation failure) when it's not.
Sure. Now how about a case where you'd need to do this? I gave an
example of where having known sized types is beneficial, but lacking them
isn't fatal. How about you give us an example where lacking known sized
types is fatal, but you don't know and can't restrict the used
implementations?
That is, show us a case where you absolutely have to have 32-bit ints,
say, but cannot know and cannot restrict the code to implementations which
support a 32-bit int.
Oh, but wait... if you *can* do this, then you don't need the new int
types anyhow, because the size of a plain old int works just fine and you
don't need these newfangled monstrosities.
(Or you can use your own typedef, defined as unsigned long on System X
and unigned int on System Y, but why bother with the authors of
<stdint.h> have already done it for you?)
Because unlike that abortion, I can rely on *my* typedefs actually
existing.
None of these will work on System Z, of course; that's not the point.
Either you accept the fact that your software isn't 100% portable
But why go out of your way to limit its portability, by adopting things
which simply will not exist? Hey, my C compiler only works if you have a
Token Ring adapter installed! Makes bugger all sense. There's enough
limits and hassles in writing portable code already, without going out of
your way to add on extra limits which don't buy anything.