only ever returns byte; uses int

I noticed that only returns one byte, as designed (and according to the docs:, but still uses an int memory location, of which the first byte will always be empty.

Shouldn't it always return a byte? Or, is this to allow for certain compatibilities somewhere?

It needs something larger than a byte for the same reason getchar() from stdio needs to return something larger than a char - so you've got a way to represent some non-character data, namely the EOF condition.

A byte can represent 256 values, namely the 256 extended ASCII values. The leaves no room for an EOF flag, so we need a larger type that will hold 256 values for a byte, plus one more value for EOF.