title: What was with the historical typedef soup for integers in C programs?
body: <p>This is a possibly inane question whose answer I should probably know.</p>
  
  <p>Fifteen years ago or so, a lot of C code I'd look at had tons of integer typedefs in platform-specific <code>#ifdef</code>s. It seemed every program or library I looked at had their own, mutually incompatible typedef soup. I didn't know a whole lot about programming at the time and it seemed like a bizarre bunch of hoops to jump through just to tell the compiler what kind of integer you wanted to use.</p>
  
  <p>I've put together a story in my mind to explain what those typedefs were about, but I don't actually know whether it's true. My guess is basically that when C was first developed and standardized, it wasn't realized how important it was to be able to platform-independently get an integer type of a certain size, and thus all the original C integer types may be of different sizes on different platforms. Thus everyone trying to write portable C code had to do it themselves.</p>
  
  <p>Is this correct? If so, how <em>were</em> programmers expected to use the C integer types? I mean, in a low level language with a lot of bit twiddling, isn't it important to be able to say "this is a 32 bit integer"? And since the language was standardized in 1989, surely there was some thought that people would be trying to write portable code?</p>