Am 13.10.2019 um 11:26 schrieb Michael Van Canneyt:


On Sun, 13 Oct 2019, Sven Barth via fpc-pascal wrote:

Just type casting because the array is an array of pointers. I get these
errors otherwise "Incompatible types: got "Pointer"
expected “TEntity"”. I could use a proper type in a generic array but I
don’t always do that.

I didn't know you could do this in a for in loop. FPC eats this ?


It currently does, but it might as well be a bug in FPC. I'll have to cross
check with Delphi.

Delphi does not allow it:

[dcc32 Error] Project1.dpr(18): E1019 For loop control variable must be simple local variable

I don't think this should be allowed, either.

Same.



Not yet.

I have no idea how you call the parser. Include files most
definitely work: the documentation generator uses fcl-passrc, and the
RTL/FCL is full of include files.

Probably your invocation of the parser is simply wrong or missing some
arguments.


Could the missing ".inc" be the problem? I have not checked, but it could
be that FPC always adds ".inc" if no extension is present.

Well spotted. I didn't notice that the extension was missing.

That will definitely not be done in fcl-passrc.

I was not aware FPC does this either. It's not documented, that's for sure:

https://www.freepascal.org/docs-html/current/prog/progsu40.html

Delphi also does not look for .inc files, I checked. It only adds extension
.pas

So, conclusion: FPC is way too lenient. ;-)

This is how FPC looks for an include file:

=== code begin ===

           { try to find the file }
           found:=findincludefile(path,name,foundfile);
           if (not found) and (ExtractFileExt(name)='') then
            begin
              { try default extensions .inc , .pp and .pas }
              if (not found) then
found:=findincludefile(path,ChangeFileExt(name,'.inc'),foundfile);
              if (not found) then
found:=findincludefile(path,ChangeFileExt(name,sourceext),foundfile);
              if (not found) then
found:=findincludefile(path,ChangeFileExt(name,pasext),foundfile);
            end;

=== code end ===

Regards,
Sven
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to