Sign in Join

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

Mailing lists / fpc-pascal / 2006-07

Strange error message?

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

John Coppens

Hi...

I was trying to compile some old TP code and got a strange error message:

program test_reg;
type
  ShTableLine= procedure(n: integer);
  procedure DummyShLine(Nr: integer);
  begin
  end;  {DummyShLine}
  procedure UseIt;
  const
    PrevProc: ShTableLine = DummyShLine;
  begin
  end;
begin
end.

This gives me the following message (referring to the 'const' line in UseIt):

Error: Incompatible types: got "DummyShLine(SmallInt)" expected "<procedure variable type of procedure(SmallInt);Register>"

I didn't declare the original as being 'register', why should it expect that later? And how to solve the problem?

Thanks!

John
PS: FPC is version 2.0.2

Marc Santhoff
to John Coppens
John Coppens wrote
PrevProc: ShTableLine = DummyShLine;

Use

    PrevProc: ShTableLine = @DummyShLine;

to tell fpc it's an address and no function call.

Have fun,
Marc

Vincent Snijders
to Marc Santhoff
Marc Santhoff wrote 12 lines
Am Freitag, den 07.07.2006, 14:40 -0300 schrieb John Coppens: > PrevProc: ShTableLine = DummyShLine; Use PrevProc: ShTableLine = @DummyShLine; to tell fpc it's an address and no function call.

or compile your code in tp mode (fpc -h for help about command line parameters).

Vincent

John Coppens
to Vincent Snijders
Show quoted text 7 lines
or compile your code in tp mode (fpc -h for help about command line parameters). Vincent _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Thanks both!

I hope this gets to the list. I had found the problem just minutes after putting the question on the net (as frequently happens), and sent a notice to the list. I had to leave, so I didn't notice that the message bounced:

: host lists.freepascal.org
[193.224.143.26] said: 554 Service unavailable; Client host [208.97.132.5] blocked using bl.spamcop.net; Blocked - see http://www.spamcop.net/bl.shtml?208.97.132.5 (in reply to RCPT TO command)

Again, appreciated...

John