This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Feature idea for gcc
- From: Russ Allbery <rra at stanford dot edu>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 29 Nov 2002 17:04:22 -0800
- Subject: Re: Feature idea for gcc
- Organization: The Eyrie
- References: <809.1038615028@www62.gmx.net>
Martin Schaffner <maschaffner@gmx.ch> writes:
> The extension would allow one to write `#use "foo.c"' instead of
> `#include "foo.h"'. If the preprocessor would hit such a directive, it
> would call an external program which would create an appropriate header
> file for the source file `foo.c', and include it. This would free the
> programmer from the task of writing a header file for every source file.
I doubt that the benefit would be worth the additional maintance cost
involved in adding and maintaining that code in the compiler, although it
is sort of interesting that it's possible to do this by checking for the
presence or absence of static (although it likely wouldn't work as easily
in conjunction with preprocessor directives that are part of the API).
The dependency information is somewhat interesting, but C compilers have
already moved very far away from being any sort of integrated development
environment that does dependency tracking, and introducing half-hearted
depencency features into the current system doesn't strike me as something
likely to be very successful. Personally, I'm of the opinion that unless
one wants to make the language inherently part of a development system,
like some Smalltalk environments, it's better to create an interoperable
set of tools that each do one thing well. Admittedly, determination of
depencencies is strongly intermingled with at least preprocessing of C
source, but once you have the dependency information, making decisions
based on it is very far afield from the rest of what a C compiler does.
--
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>