[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#21707: include-file cleanup for src directory
From: |
Andy Moreton |
Subject: |
bug#21707: include-file cleanup for src directory |
Date: |
Tue, 20 Oct 2015 20:28:33 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (windows-nt) |
On Tue 20 Oct 2015, Paul Eggert wrote:
> Eli Zaretskii wrote:
>> Would it help if we avoid including any of our headers in any
>> other of our headers, so that the headers included by a particular C
>> file are visible by just looking at that single C file?
>
> That would run afoul of a more important design goal, which is that we should
> be able to include headers in any order. And anyway, compiling a typical C
> file ordinarily brings in oodles of system headers that the C file doesn't
> explicitly ask for, so regardless of our style the only practical way to see
> what headers a C file includes is to compile it and see what gcc -E outputs.
>
> Ideally a C source file should include all headers that define symbols the
> source file directly uses, and no headers other than that. This should be true
> for both .h and .c files. We're not there by a long shot, but that should be
> the goal.
...and also include headers for anything exported by the C file to
ensure that declarations and definitions are not incompatible.
AndyM
- bug#21707: include-file cleanup for src directory, (continued)
- bug#21707: include-file cleanup for src directory, Eli Zaretskii, 2015/10/19
- bug#21707: include-file cleanup for src directory, Andy Moreton, 2015/10/19
- bug#21707: include-file cleanup for src directory, Paul Eggert, 2015/10/20
- bug#21707: include-file cleanup for src directory, Eli Zaretskii, 2015/10/20
- bug#21707: include-file cleanup for src directory, Paul Eggert, 2015/10/20
- bug#21707: include-file cleanup for src directory, Eli Zaretskii, 2015/10/20
- bug#21707: include-file cleanup for src directory, Paul Eggert, 2015/10/20
- bug#21707: include-file cleanup for src directory,
Andy Moreton <=
bug#21707: include-file cleanup for src directory, Paul Eggert, 2015/10/20