[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Make clean solves problem ---> here's why...
From: |
Manor Askenazi |
Subject: |
Make clean solves problem ---> here's why... |
Date: |
Fri, 17 Jan 1997 05:15:28 -0700 |
*************************************************************************
* Actually, I did a `make clean' this morning and it seems to be working. *
*************************************************************************
Hi David!
This proves that the trouble you were having is of the form alluded to
by Ginger in her message:
David,
Since I'm not good about keeping my Makefile scrupulously correct,
I often get whacked errors when I add to a class. Deleting all binaries
and re-making is my first step. Just a thought.
Ciao,
Ginger
It's worth understanding exactly what this problem is about because
it is bound to trip you more than once ----> I remember one similar
incident which almost cost the Institute a keyboard or a screen :-)
In any case, here's a slightly longer explanation of what Ginger is
referring to:
Imagine that you have two classes A and B, where B inherits from A.
Assume also, that initially you compile your program and everything
works great...
Now imagine that you edit the source for class A and recompile it.
Well, it is very likely that your makefile will not force the
recompilation of class B (unless you were very careful to specify
that B.o depends on A.h).
This error tends to go unnoticed because, in general, editing class
A will not affect class B unless you screw around with the size of
A or the layout of A's instance variables (basically by declaring
new variables or removing old variables or by changing the type of
a variable).
Note that even if you *are* careful to ensure that in your makefile,
B.o depends on (changes in) A.h (which is where its instance variables
are declared), you could still get screwed -- this can happen if you
have A is the superclass of B is the superclass of C. Now, even if you
ensure that B will be re-compiled if A is re-compiled, C will not get
re-compiled because B.h was not changed!
My guess is that to ensure a truly 100% correct compilation one would
have to specify a dependency from C.o to B.o and from B.o to A.o...
But I have never seen such a Makefile.
Does anybody out there do this???
Who knows... :-)
Manor.
PS> A grown-up environment/compiler would automatically track all this
sort of shit for you...
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Make clean solves problem ---> here's why...,
Manor Askenazi <=