GNU bug report logs -
#21707
include-file cleanup for src directory
Previous Next
Reported by: Paul Eggert <eggert <at> cs.ucla.edu>
Date: Mon, 19 Oct 2015 07:07:02 UTC
Severity: wishlist
Tags: patch
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
Message #38 received at 21707 <at> debbugs.gnu.org (full text, mbox):
On 10/20/2015 12:15 PM, Eli Zaretskii wrote:
> Even standard C headers sometimes require order, for example,
> sys/types.h should be included before sys/stat.h.
Oh my goodness your memory goes a long way back! But the C Standard
never required a particular header order (it never standardized
sys/types.h or sys/stat.h). POSIX did originally require that one must
include both <sys/types.h> and <sys/stat.h> before using functions like
'stat', but that requirement was removed a while ago; e.g., nowadays
only <sys/stat.h> must be included before using 'stat'. And it's not
hard to see why the old POSIX requirement was removed: a .h file should
describe an API standalone, to avoid unnecessarily constraining the
API's users.
> I thought we could perhaps come up with a method that would allow
> anyone easily see which headers are needed on every supported platform
I started something along those lines, but it's harder than it looks.
The current patch came from my woefully-inadequate approximation to the
tools I wanted.
> I think the real problem is to keep this state once we get there.
Yes. Part of the job would be to write better checking tools. And part,
I expect, would be to simplify Emacs's complicated uses of headers. For
example, although we sometimes have headers A and B that use each
others' symbols, it wouldn't be cool to have both A #include B and B
#include A. Some of this simplification will likely be needed anyway, as
we change more macros to inline functions.
This bug report was last modified 9 years and 217 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.