News for hackers. Stuff that matters.
Re:EOF is not a character by matheusmoreira on Saturday March 14, 2020 @04:42AM (#22574006)
> Magical sentinels crammed into return values — like EOF returned by getchar() or -1 returned by ftell() or NULL returned by malloc() — are one of C's drawbacks.

They're part of the C standard library. The POSIX I/O APIs don't have these problems. The Linux I/O system calls are even better because they don't have errno.

Honestly, the C standard library just isn't that good. Freestanding C is a better language precisely because it omits the library and allows the programmer to come up with something better.

Re:EOF is not a character by TheCoelacanth on Saturday March 14, 2020 @09:38AM (#22575187)
I think that's being too kind. The C standard library is terrible.
Re:EOF is not a character by matheusmoreira on Saturday March 14, 2020 @10:19AM (#22575436)
To be fair, the libraries found in other languages aren't much better. Ruby's standard library was the most comfortable in my experience but it still has glaring flaws.