This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Feature idea for GCC: link dependencies


On Freitag, Juli 11, 2003, at 02:26  Uhr, Michael N. Moran wrote:

> Hi Martin,
> 
> I agree that makefile maintenance is a pain,
> and that makefile automation and dependency generation
> is essential to enable programmers to concentrate
> on the problem rather than the tedium.
> 
> However (you knew that was coming ;-) I have to say
> that IMHO automatic header file generation is a bad idea.
> I say this because in my mental model, the header file
> is the interface description of the module, and that
> interface definition precedes the implementation that is
> the ".c" file.
> 
> Further, it is often desirable to share a common
> header file between two different implementations.
> 
> This separation of interface and implementation
> is one of the big reasons that I much prefer
> C/C++ over Java.
> 
> Just thought you might like another point-of-view.
> 
> mike
> 

Hi Mike,

I reply with a CC to gcc@gcc.gnu.org because other people might have similar
concerns as you.

When I mailed my idea last year to gcc@gcc.gnu.org, I got similar feedback
to the one you give me now. But I "fixed" my idea since. Let me explain.

First, I split  my idea into two parts: automatic header file generation and
automatic makefile generation. They complement each other, but you can
implement one without implementing the other one. The last mail to gcc@gnu.org
concerned the implementation of automatic makefile generation, which is less
controversial. To understand how it works, please read the presentation
(http://in3www.epfl.ch/~schaffne/use/use.pdf), and skim through the example project
(http://in3www.epfl.ch/~schaffne/use/tetris_conv.zip), and through the same
project making use of automatic makefile generation
(http://in3www.epfl.ch/~schaffne/use/tetris_linkdep.zip)

Now, to automatic header file generation. I agree that it's not always a
good idea to use this feature. I handled the case of a common header file for
different implementation in the example project. Having this feature in GCC
wouldn't force anybody to use it (except if he would have to maintain code using
it). An example where it would be useful is when somebody wants to split a
module into two compilation units. In this case he would only have to add a .c
file, and a second .h file wouldn't be necessary. If the preprocessor of GCC
were to use the feature, it would only have to have cpplib.h, and cpphash.h
wouldn't be necessary.

Thanks

Martin Schaffner

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++

Jetzt ein- oder umsteigen und USB-Speicheruhr als Prämie sichern!


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]