Sign in Join

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

Mailing lists / fpc-devel / 2003-06

Unit not used ?

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Jeff Pohlmeyer

Ever since upgrading to CVS 1.0.7 [2003/04/02] for i386, I have been getting some strange compiler hints:

  unit_one.pp(119,13) Hint: Unit UNIT_TWO not used in UNIT_ONE

Even though the unit actually is used.

I could try to track down the problem, but the units in question are quite large, so I am wondering if anyone else knows what causes this.

Is this a compiler bug, or is it trying to tell me I should move something around ?

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com

Reply by email

Jonas Maebe
to Jeff Pohlmeyer
Jeff Pohlmeyer wrote 12 lines
Ever since upgrading to CVS 1.0.7 [2003/04/02] for i386, I have been getting some strange compiler hints: unit_one.pp(119,13) Hint: Unit UNIT_TWO not used in UNIT_ONE Even though the unit actually is used. I could try to track down the problem, but the units in question are quite large, so I am wondering if anyone else knows what causes this. Is this a compiler bug, or is it trying to tell me I should move something around ?

Normally, this means that even though you put "uses unit_two" in unit one, you're not using any procedure, type or global variable from unit_two in unit_one and unit_two also doesn't have an initialization section. So you can just remove the "uses unit_two;" from unit_one and unit_one should still compile and work correctly.

Jonas

Reply by email

Jeff Pohlmeyer
> unit_one.pp(119,13) Hint: Unit UNIT_TWO not used in UNIT_ONE > Even though THE UNIT ACTUALLY IS USED.
Show quoted text 5 lines
Normally, this means that even though you put "uses unit_two" in unit one, you're not using any procedure, type or global variable from unit_two in unit_one and unit_two also doesn't have an initialization section. So you can just remove the "uses unit_two;" from unit_one and unit_one should still compile and work correctly.

Thanks for your response, Jonas -

There are things in UNIT_TWO on which UNIT_ONE depends. Removing "uses unit_two;" results in a compiler error:

Undeclared identifier 'SOMETHING'

That "SOMETHING" is declared in UNIT_TWO

But putting an empty initialization section in UNIT_TWO eliminates the message.

I will try to see if I can come up with a simple example to reproduce the problem, but the project is about 3800 lines, spread across twelve different units, so it is a bit too large to post it here...

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM). http://calendar.yahoo.com

Reply by email

Peter Vreman
to Jeff Pohlmeyer
you wrote 27 lines
> > unit_one.pp(119,13) Hint: Unit UNIT_TWO not used in UNIT_ONE > > Even though THE UNIT ACTUALLY IS USED. > Normally, this means that even though you put "uses unit_two" in unit > one, you're not using any procedure, type or global variable from > unit_two in unit_one and unit_two also doesn't have an initialization > section. So you can just remove the "uses unit_two;" from unit_one and > unit_one should still compile and work correctly. Thanks for your response, Jonas - There are things in UNIT_TWO on which UNIT_ONE depends. Removing "uses unit_two;" results in a compiler error: Undeclared identifier 'SOMETHING' That "SOMETHING" is declared in UNIT_TWO But putting an empty initialization section in UNIT_TWO eliminates the message. I will try to see if I can come up with a simple example to reproduce the problem, but the project is about 3800 lines, spread across twelve different units, so it is a bit too large to post it here...

Can you try it with the 1.1 compiler, because this will not be fixed anymore in the 1.0.x series.

Peter

Reply by email