Hi Laslo On Tue, Dec 6, 2016 at 12:51 PM, Laslo Hunhold <d...@frign.de> wrote: > On Tue, 6 Dec 2016 10:26:22 +0100 > Silvan Jegen <s.je...@gmail.com> wrote: >> It only compiled for me because "util.h" includes stdio.h so the >> definitions are included already. We can still remove this include if >> we don't want it to be included twice but I don't know which approach >> is preferred here. > > we definitely need to include it here as your implementation does not > represent everyone's implementation. If Posix demands to include > something for a given function, we should include it.
What I meant is that cksum.c includes <stdio.h> transitively (because cksum.c includes "util.h" which includes <stdio.h>). As far as I know, the setup of my development environment should not matter in that case and the code should compile on any C compiler (with a preprocessor) without having to include <stdio.h> in cksum.c again. Including <stdio.h> directly in cksum.c makes the dependency more explicit though and even if this results in the code of the header being included again (as I think it will), I doubt it will have a big impact on compilation speed. Cheers, Silvan