View Issue Details

IDProjectCategoryView StatusLast Update
0025410FPCCompilerpublic2020-11-15 22:03
Reporterajax16384 Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version2.6.2 
Summary0025410: macros compilation error message should dump all macro call stack
DescriptionCompilation error message about code that uses macros shows only macro definition position. I guess fpc should dump all macro evaluation stack (all fault macro calling lines).
Steps To Reproduceprogram TestMacro;
{$MACRO ON}
{$define SubstFoo:=RealFoo}
  procedure RealFoo(v: Int64); overload;
  begin
  end;
  procedure RealFoo(v: Integer); overload;
  begin
  end;
var
  u: UInt64;
  i: Integer;
begin
  SubstFoo(u); // 14 line
  SubstFoo(i);
  RealFoo(u); // 16 line
  RealFoo(i);
end.

fpc error output:
TestMacro.dpr(3,8) Error: Can't determine which overloaded function to call
TestMacro.dpr(16,3) Error: Can't determine which overloaded function to call
TestMacro.dpr(18,4) Fatal: There were 2 errors compiling module, stopping
Fatal: Compilation aborted

"TestMacro.dpr(3,8)" points only to macro definition line, but not to real macro calling location.
Expected error message should looks like:
TestMacro.dpr(14,3); TestMacro.dpr(3,8) Error: Can't determine which overloaded function to call
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Activities

ajax16384

2020-11-15 22:03

reporter   ~0126977

"-vh" will show ambigous function declaration. Issue can be marked resolved.

Issue History

Date Modified Username Field Change
2013-12-08 15:41 ajax16384 New Issue
2020-11-15 22:03 ajax16384 Note Added: 0126977