[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: openat includes
From: |
Bruno Haible |
Subject: |
Re: openat includes |
Date: |
Sat, 5 Nov 2011 12:23:56 +0100 |
User-agent: |
KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; ) |
Jim Meyering wrote:
> > you may want to remove
> > include <stdbool.h> from it tomorrow, when refactoring openat_needs_fchdir
> > in some way.
>
> I see your point, but don't you think that if someone were to
> remove openat_needs_fchdir and the inclusion of <stdbool.h>,
> they would try to verify that openat.c still compiles?
For uses of 'bool', which would give a syntax error if <stdbool.h>
is not included, you're right.
But more generally, it happens to have missing #includes after changes.
See these ChangeLog entries:
2011-11-04 Bruno Haible <address@hidden>
closedir: Avoid warning on mingw.
* lib/closedir.c: Include <unistd.h>.
2011-10-30 Bruno Haible <address@hidden>
ffsl, ffsll: Avoid compilation error due to 'restrict'.
* lib/ffsl.h: Include <config.h>.
Suggested by Tom G. Christensen <address@hidden>.
2011-10-20 Bruno Haible <address@hidden>
openpty: Avoid compilation error on AIX 6.1.
* lib/pty.in.h [AIX]: Include <sys/ioctl.h>, for 'struct winsize'.
2011-09-25 Bruno Haible <address@hidden>
strings: Fix compilation error on MSVC.
* lib/strings.in.h: Include <stddef.h> for size_t.
2011-07-11 Eric Blake <address@hidden>
regex: avoid compiler warning
* lib/regex.c (includes): Include <strings.h>, for use of
strcasecmp in regcomp.c.
Reported by Joachim Schmitz.
2011-03-13 Bruno Haible <address@hidden>
passfd: Fix compilation error on OpenBSD.
* lib/passfd.c: Include <sys/uio.h>.
While you are right that for <stdbool.h> you don't need to be so careful
about whether you've included it or not, it is a general good guideline
to #include all include files that are "apparently" needed for the given
source code (according to POSIX) in the same file, except - like Paul
said - those that are already included in the interface .h file.
Bruno
--
In memoriam Bernhard Lichtenberg
<http://en.wikipedia.org/wiki/Bernhard_Lichtenberg>