[fpc-pascal] When are used units recompiled?

Michael Van Canneyt michael at freepascal.org
Thu Apr 6 11:15:49 CEST 2006



On Wed, 5 Apr 2006, Micha Nelissen wrote:

> On Wed, 5 Apr 2006 19:27:07 +0200 (CEST)
> Michael Van Canneyt <michael at freepascal.org> wrote:
> 
> > On Wed, 5 Apr 2006, Micha Nelissen wrote:
> > 
> > > I don't agree: RTFM is *not* an excuse for insightful, to-the-point,
> > > clear, not too elaborate error messages.
> > 
> > Yes, and the 'elaborateness' is controlled by the -v setting.
> > 
> > The point is that "Can't find unit foo" can have several causes.
> 
> Exactly! So: split them out, with a separate message for each of them.
> That's why we have separate messages anyway, right? To be helpful...
>  
> > To find out the exact cause, you must use -vu. To find out even 
> > more, you use -vut. after that, it's -va...
> > 
> > RTFM is not an excuse, but people should also take some initiative 
> > and start looking for the cause of trouble. The first thing is to 
> > increase the verboseness of the compiler... For this, you should
> > read the manual.
> 
> In one of the cases above, of the "several causes", you might need extra
> verbosity indeed, but there are at least two cases where a more helpful and
> to the point error message can be given.
> 
> If you do not want to prioritize this item, it's fine, but please keep it
> open at wishlist level.
> 
> > It's hard to determine the exact number/amount of messages that is 
> > useful to detect/resolve problems. To get more 'feeling' for how 
> > to resolve problems, one can and should read the manual...
> 
> This very much sounds like the C mentality TBH: assume people know
> exactly what they are doing or burn them with cryptic error messages:
> one needs to debug it all in the aclocal/autoconf/automake/configure/...
> scripts and figure it out yourself.
> 
> I'm not saying people shouldn't read manuals...just saying that "Can't find
> unit" can be split up in 3 or so "causes", and a more helpful message given
> for each of them.

That may be harder than you think, because the routines looking for a unit
source do not know WHY they are looking for this. 

So they just report 'sorry, we didn't find what you requested".
(you=other compiler routines)

At the moment when the compiler decides it needs to recompile a unit 
and starts looking for sources, it doesn't know yet whether it will 
find it or not, so it has no sense outputting a message then.
You would get far too many messages.

Yes, you could pass on a 'reason' why a unit is searched, and then 
output that, but it would make the compiler slower and more complicated.

So, for this, you need to use -vu. Then you can follow the compiler's 
logic exactly...

Which doesn't mean we shouldn't maybe rephrase some messages, but just 
don't get your hopes up too high :-)

Michael.



More information about the fpc-pascal mailing list