Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2010-04

compilation feeback

6 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

spir ☣

Hello,

3 little questions about messages:

-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?

-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).

-3- linker message
I systematically get
'/use/bin/ld: warning: link.res contains output sections; did you forget -T?' What does this mean?

Thank you,
Denis
________________________________

vit esse estrany ☣

spir.wikidot.com

Reply by email

Jonas Maebe
to spir ☣
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.

Show quoted text 5 lines
-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.

Show quoted text 5 lines
-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

Jonas

Reply by email

Graeme Geldenhuys
to spir ☣: 3 little questions about messages: -1- "local" variable When a program-global variable is…

spir ☣ het geskryf:

Show quoted text 5 lines
-3- linker message I systematically get '/use/bin/ld: warning: link.res contains output sections; did you forget -T?' What does this mean?

I get this often, and also don't have a clue what it means. Yet our applications still seem to run fine. Go figure?? :-/

I'm using Ubuntu 8.04.2 64-bit with FPC 2.4.1 (64-bit).

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/

Reply by email

spir ☣
to Graeme Geldenhuys
Show quoted text 7 lines
> '/use/bin/ld: warning: link.res contains output sections; did you forget -T?' > What does this mean? I get this often, and also don't have a clue what it means. Yet our applications still seem to run fine. Go figure?? :-/ I'm using Ubuntu 8.04.2 64-bit with FPC 2.4.1 (64-bit).

I get it systematically on ubuntu 9.10

denis
________________________________

vit esse estrany ☣

spir.wikidot.com

Reply by email

spir ☣
to Jonas Maebe: Such variables are local to the current program or to the unit (in case they are declared…
Show quoted text 11 lines
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.

Show quoted text 7 lines
> -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.]

Show quoted text 7 lines
> -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

Reply by email