Recent

Author Topic: Wrong error location when using macro  (Read 2108 times)

alpine

  • Hero Member
  • *****
  • Posts: 1412
Wrong error location when using macro
« on: July 11, 2021, 03:35:04 pm »
Lazarus 2.0.12 r64642 FPC 3.2.2 i386-win32-win32/win64

Given the following two files:
Code: Pascal  [Select][+][-]
  1. program Project1;
  2.  
  3. {$MACRO ON}
  4. {$DEFINE module:=unit1}
  5.  
  6. uses unit1;
  7.  
  8. begin
  9.   module.Moo(1, 2);
  10.   module.Moo(1);
  11. end.

and unit1.pas:
Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils;
  9.  
  10. procedure Moo(A1, A2: Integer);
  11.  
  12. implementation
  13.  
  14. procedure Moo(A1, A2: Integer);
  15. begin
  16. end;
  17.  
  18. end.

The compiler gives the following error:
Code: [Select]
project1.lpr(4,6) Error: Wrong number of parameters specified for call to "Moo"which is the location of I in {$DEFINE. The error is actually on the 10-th line.

I believe it is a bug. Someone advice how to proceed regarding the present situation, migration to GitLab, etc.

"I'm sorry Dave, I'm afraid I can't do that."
—HAL 9000

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12837
  • FPC developer.
Re: Wrong error location when using macro
« Reply #1 on: July 11, 2021, 04:21:43 pm »
Just report it in mantis. The definitive conversion of mantis still must happen

alpine

  • Hero Member
  • *****
  • Posts: 1412
"I'm sorry Dave, I'm afraid I can't do that."
—HAL 9000

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12837
  • FPC developer.
Re: Wrong error location when using macro
« Reply #3 on: July 11, 2021, 05:55:26 pm »
Thanks

 

TinyPortal © 2005-2018