|
|
|
|
|
by Animats
2283 days ago
|
|
In the beginning, there was the int. In K&R C, before function prototypes, all functions returned "int". ("float" and "double" were kludged in, without checking, at some point.)
So the character I/O functions returned a 16-bit signed int. There was no way to return a byte, or a "char". That allowed room for out of band signals such as EOF. It's an artifact of that era. Along with "BREAK", which isn't a character either. |
|
GCC only outputs a warning by default: "warning: return type defaults to ‘int’ [-Wimplicit-int]"