This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Include file visibility scopes? (Was: Re: [RFC] Include file structuring.)
- From: Joern Rennecke <joern dot rennecke at embecosm dot com>
- To: Andrew MacLeod <amacleod at redhat dot com>
- Cc: Jeff Law <law at redhat dot com>, GCC <gcc at gcc dot gnu dot org>, Richard Biener <richard dot guenther at gmail dot com>, Diego Novillo <dnovillo at google dot com>
- Date: Wed, 23 Oct 2013 04:09:39 +0100
- Subject: Include file visibility scopes? (Was: Re: [RFC] Include file structuring.)
- Authentication-results: sourceware.org; auth=none
On 22 October 2013 21:07, Andrew MacLeod <amacleod@redhat.com> wrote:
> I think this is transitional. Its such a mess right now, that I think we
> need to flatten the entire thing, and then rebuild it with some modular
> design in place such that routines and data structures are where they
> belong. then we can consider including things that are prerequesites.
Hmm. It seems this include dependency morass is really a trap for any
big C / C++ project.
And once you have straightened it out, it'll might creep back over the
years as more
data structure redesign and refactoring goes on.
I wonder what it'd take to have a cpp extension to include a file in
such a manner as to
emit a diagnostic if the items declared / #defined inside are used
directly by a file
that includes the file that does the thus guarded include.
We already have some tracking of where source comes from now for the purposes
of printing include backtraces...
Woud probably want to re-set the usable scope if there is a later include of the
same file, mutliple-include-guards notwithstanding...