<font color='black' size='2' face='arial'><font size="2">Hi! I don't want to fill a useless bug report, reason why I check this again, this time with you.<br>
The following code syntax doesn't compile.<br>
<br>
<br>
</font>{$mode objfpc}{$H+}<br>
{$MACRO ON} <br>
<br>
begin<br>
{$define debugmacros:=<br>
function variabletype_passingmode_one(passingmode x,y:variabletype):variabletype;localmodifier<br>
begin if x=y then Result:=1 else result:=0;end;<br>
function variabletype_passingmode_two(passingmode x,y:variabletype):variabletype;localmodifier<br>
begin if x<>y then Result:=1 else result:=0;end;<br>
}<br>
<br>
{$define variabletype:=longint}{$define passingmode:=var}{$define localmodifier:= }<br>
debugmacros<br>
{$undef variabletype}{$undef passingmode}{$undef localmodifier}<br>
<br>
{$define variabletype:=longint}{$define passingmode:=const}{$define localmodifier:=}<br>
debugmacros<br>
{$undef variabletype}{$undef passingmode}{$undef localmodifier}<br>
end;<br>
<br>
The messages:<br>
<br>
Compile Project, Target: ConditionalJumpsAnalysis: Exit code 256, Errors: 4, Warnings: 50, Hints: 2<br>
ConditionalJumpsAnalysis.lpr(31,2) Warning: Comment level 2 found<br>
ConditionalJumpsAnalysis.lpr(59,10) Error: overloaded functions have the same parameter list<br>
ConditionalJumpsAnalysis.lpr(59,10) Error: Found declaration: variabletype_passingmode_one(var LongInt;var LongInt):LongInt;<br>
ConditionalJumpsAnalysis.lpr(61,10) Error: overloaded functions have the same parameter list<br>
ConditionalJumpsAnalysis.lpr(61,10) Error: Found declaration: variabletype_passingmode_two(var LongInt;var LongInt):LongInt;<br>
<br>
Looking at the messages it appears that the syntax is checked after a
partial replacement. The "passingmode" within the parenthesis is
replaced but the one found in the function name <font size="2">is </font>not<font size="2">, although they are found within the same text line</font>.<font size="2"> After replacing the one found within the parenthesis a syntax check is done before replacing the other one found at the same line, I guess.</font><br>
Is this a <font size="2">situation where the documentation is not clear enough, a </font>limitation or a bug? Programmers guide <font size="2">states that macros work recursive. Or maybe I've done a mistake somewhere. Anyway, </font>I'm using fpc and Lazarus svn<font size="2">, and I've checked this situation on forum before asking you.<br>
<br>
</font>
</font>