T
Thomas Scrace
Hi all,
I am working through K&R, and I got to section 1.9, which includes an example
that creates a function 'getline'. I duly typed it all up, and compiled it with
gcc. Surprisingly I got an error telling me of incompatible types for this
function.
It turns out that GNU's C library now includes a function called getline, and
since I was including stdio.h, this was the cause of the problem. I recompiled
using c89, and everything worked fine.
My question is this: should we not make an effort to keep the modern C toolchain
and library compatible with the great K&R, unless doing so would create an even
more undesirable outcome?
Tom
I am working through K&R, and I got to section 1.9, which includes an example
that creates a function 'getline'. I duly typed it all up, and compiled it with
gcc. Surprisingly I got an error telling me of incompatible types for this
function.
It turns out that GNU's C library now includes a function called getline, and
since I was including stdio.h, this was the cause of the problem. I recompiled
using c89, and everything worked fine.
My question is this: should we not make an effort to keep the modern C toolchain
and library compatible with the great K&R, unless doing so would create an even
more undesirable outcome?
Tom