[fpc-pascal] compilation feeback

spir ☣ denis.spir at gmail.com
Fri Apr 30 10:51:28 CEST 2010


On Fri, 30 Apr 2010 09:51:44 +0200
Jonas Maebe <jonas.maebe at elis.ugent.be> wrote:

> 
> On 30 Apr 2010, at 09:40, spir ☣ wrote:
> 
> > -1- "local" variable
> > When a program-global variable is unused, the compiler message reads  
> > 'Note: Local variable "x" not used'.
> > Is this a mistake or do I misunderstand some point?
> 
> Such variables are local to the current program or to the unit (in  
> case they are declared in the implementation of a unit). We could just  
> remove the "local" though.

Right. Say they're not always really global, but "local" sounds a bit misleading to me.

> > -2- place of error messages
> > In the output, warnings seem to always come before the deadly  
> > 'Compilation failed'. But error messages seem to randomly be placed  
> > before, after, or even both. Is there a logic I don't catch behind  
> > this? Or is it a bug of my terminal's writing system (I use a VTE).
> 
> I've never seen that.

May be the VTE messes up stream(s). [But this is also related to the stream source. Eg the same VTE used to mess up stdout and stderr streams from another language. Since a given version of the lang (python), this does not happen anymore.]

> > -3- linker message
> > I systematically get
> > '/use/bin/ld: warning: link.res contains output sections; did you  
> > forget -T?'
> > What does this mean?
> 
> http://www.freepascal.org/faq.var#unix-ld219

Thank you very much. Below the FAQ entry:

======
An error occurred while linking, or "did you forget -T?"

There is a bug in GNU LD 2.19 and 2.19.1 that causes it to crash when processing FPC-generated linker scripts. This bug has been fixed in the mean time.

At the same time, LD has been modified to emit a warning of the form

               /usr/bin/ld: warning: link.res contains output sections; did you forget -T?
            

This warning is benign, and FPC intentionally does not pass -T to LD. The reason is that if -T is used, LD's internal linker script is ignored and only FPC's linker script is used. Such linker scripts also contain paths to libraries however, and if we would ignore the internal linker script then LD would no longer find libraries in distribution-specific directories.
=======

Isnt't it possible to switch off specific (types of) ld warnings? Sure, it's not a big deal since we know we can safely ignore this very message. But the output does not look clean, actually it looks like wrong, even more since this very warning is painted red ;-)
Anyway...

Denis
________________________________

vit esse estrany ☣

spir.wikidot.com



More information about the fpc-pascal mailing list