On Mon, 19 Mar 2007, Nick ! wrote:
> On 3/19/07, hiren <[EMAIL PROTECTED]> wrote:
> > hi all,
> >
> > i found it interesting that cat.c compiles after removing these
> > includes:
> >
> > #include <ctype.h>
> > #include <err.h>
> > #include <errno.h>
> > #include <string.h>
> > #include <unistd.h>
> >
> > im just curious to hear opinions and learn something ;)
>
> That's probably because all these files are implicitly included by
> some other include files. However, it is more correct to keep them all
> here explicitly because cat.c uses them directly; you should want
> someone reading the code to have a list of 'libraries' it relies on.
>
> Good question.
Compile with -Wall and draw your conclusions.
While it's legal to call a undeclared function, it is not wise to do
so.
-Otto