[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Moving #include <stdio.h> into _scm.h
From: |
Dirk Herrmann |
Subject: |
Re: Moving #include <stdio.h> into _scm.h |
Date: |
Sat, 10 Mar 2001 10:14:06 +0100 (MET) |
On Sat, 10 Mar 2001, Keisuke Nishida wrote:
> At Sat, 10 Mar 2001 09:18:55 +0100 (MET),
> Dirk Herrmann wrote:
> >
> > > Hmm... I'd rather go in the other direction: Remove things from _scm.h
> > > that not all files need and remove #include <stdio.h> from files which
> > > don't use stdio. I'm sure that only a minority of the 79 files
> > > including stdio really needs it.
> >
> > Yes! It's annoying if files get rebuilt that don't actually need to if
> > some include file changes. With system headers, this occurs less
> > frequent, but it's definitely true for all libguile headers that are
> > included via _scm.h.
>
> But it is annoying to me to include such common headers as stdio.h
> in each file... Since _scm.h already includes errno.h, you have to
> recompile all files anyway if you update your system headers.
As I see it, errno is only needed in files that do system calls. Thus, in
the long term we may decide to extract the corresponding definitions into
a file of its own. But, for the moment you are right that an update to
the system headers would mean to recompile all files :-(
Still, including files unnecessarily does influence compile time and
memory usage of the compilation. If I understood you correctly, stdio.h
was included in 79 files, although it was only needed in 24. I am not
going to measure the additional time required to unnecessarily include
stdio.h 54 times, or even (if it was included in _scm.h) unnecessarily
include it 85 times unnecessarily - it probably won't be much, but still.
For examples as the above, I think it is OK if _one_ programmer has a
little bit of an extra effort rather than that _n_ regular updaters of the
CVS are annoyed because their rebuild process takes longer than necessary.
I think we agree that if _n_ is large enough, the accumulated annoyance of
the updaters outweighs the single annoyance of the one developer :-)
Best regards,
Dirk Herrmann