Forum > General
Can someone that uses KOL too look into this parsing problem
(1/1)
Thaddy:
For some reason the KOL versions 322 and 323 (incl unofficial) give errors when compiling with very recent trunk FPC.
I have no clue why.. It used to work. Did the parser change? (KOL is extremely difficult to parse except for Delphi and FPC itself)
Can somebody try to compile a simple KOL program (f.e. from the wiki) with TRUNK and at least KOL 3.22?
That would be very helpful.
I am interested IF it fails or not.
I am also interested why, but I will do the investigation too if confirmed.
Delphi 32/64 is still OK.
I am looking into this about 24 hours and can not find a clue. Of course everything clean-roomed, so plz count that out.
Maybe the compiler team is interested because of KOL's parse challenge.
rvk:
Do you mean trying KOL v3.23.5 from http://kolmck.net/ ?
That one still has {$IFDEF VER2} in KOLDEF.INC (so a lot of the defines for FPC2.6 are not used in trunk??) and I get an error at MakeIntAtom := MakeIntAtomA (line 683) in KOL_ansi.inc and multiple others. MakeIntAtomA (and some others) would be in jwawinbase.pas but TFNFontEnumProcA isn't to be found in the whole source of FPC trunk. (I haven't looked any further) Were these the errors you were referring to?
(I get the same errors in FPC2.6.4)
--- Quote ---Compile Project, Target: koldemo.exe: Exit code 1, Errors: 50, Warnings: 9
KOLDEF.INC(50,2) Warning: Illegal identifier "UNSAFE_TYPE" for $WARN directive
KOLDEF.INC(51,2) Warning: Illegal identifier "UNSAFE_CAST" for $WARN directive
KOLDEF.INC(52,2) Warning: Illegal identifier "UNSAFE_CODE" for $WARN directive
KOLDEF.INC(50,2) Warning: Illegal identifier "UNSAFE_TYPE" for $WARN directive
KOLDEF.INC(51,2) Warning: Illegal identifier "UNSAFE_CAST" for $WARN directive
KOLDEF.INC(52,2) Warning: Illegal identifier "UNSAFE_CODE" for $WARN directive
kol.pas(556,4) Warning: Illegal identifier "UNSAFE_TYPE" for $WARN directive
kol.pas(557,4) Warning: Illegal identifier "UNSAFE_CODE" for $WARN directive
kol.pas(558,4) Warning: Illegal identifier "UNSAFE_CAST" for $WARN directive
KOL_ansi.inc(683,17) Error: Identifier not found "MakeIntAtomA"
KOL_ansi.inc(683,29) Error: Error in type definition
KOL_ansi.inc(687,20) Error: Identifier not found "PHWProfileInfoA"
KOL_ansi.inc(687,35) Error: Error in type definition
KOL_ansi.inc(688,20) Error: Identifier not found "THWProfileInfoA"
KOL_ansi.inc(688,35) Error: Error in type definition
KOL_ansi.inc(698,24) Error: Identifier not found "TFNOldFontEnumProcA"
KOL_ansi.inc(698,43) Error: Error in type definition
KOL_ansi.inc(699,21) Error: Identifier not found "TFNFontEnumProcA"
KOL_ansi.inc(699,37) Error: Error in type definition
KOL_ansi.inc(704,19) Error: Identifier not found "PMsgBoxParamsA"
KOL_ansi.inc(704,33) Error: Error in type definition
KOL_ansi.inc(718,25) Error: Identifier not found "TPRMsgBoxCallback"
KOL_ansi.inc(718,42) Error: Error in type definition
KOL_ansi.inc(731,25) Error: Identifier not found "TPRMsgBoxCallback"
KOL_ansi.inc(731,42) Error: Error in type definition
KOL_ansi.inc(744,22) Error: Identifier not found "PMDICreateStructA"
KOL_ansi.inc(744,39) Error: Error in type definition
KOL_ansi.inc(745,22) Error: Identifier not found "TMDICreateStructA"
KOL_ansi.inc(745,39) Error: Error in type definition
KOL_ansi.inc(888,17) Error: Identifier not found "PSerialKeysA"
KOL_ansi.inc(888,29) Error: Error in type definition
KOL_ansi.inc(889,17) Error: Identifier not found "TSerialKeysA"
KOL_ansi.inc(889,29) Error: Error in type definition
KOL_ansi.inc(922,19) Error: Identifier not found "PHighContrastA"
KOL_ansi.inc(922,33) Error: Error in type definition
KOL_ansi.inc(923,19) Error: Identifier not found "THighContrastA"
KOL_ansi.inc(923,33) Error: Error in type definition
KOL_ansi.inc(948,18) Error: Identifier not found "PSoundsEntryA"
KOL_ansi.inc(948,31) Error: Error in type definition
KOL_ansi.inc(949,18) Error: Identifier not found "TSoundsEntryA"
KOL_ansi.inc(949,31) Error: Error in type definition
KOL_ansi.inc(992,16) Error: Identifier not found "PNumberFmtA"
KOL_ansi.inc(992,27) Error: Error in type definition
KOL_ansi.inc(993,16) Error: Identifier not found "TNumberFmtA"
KOL_ansi.inc(993,27) Error: Error in type definition
KOL_ansi.inc(1024,18) Error: Identifier not found "PCurrencyFmtA"
KOL_ansi.inc(1024,31) Error: Error in type definition
KOL_ansi.inc(1060,13) Error: Identifier not found "PPValueA"
KOL_ansi.inc(1060,21) Error: Error in type definition
KOL_ansi.inc(1083,15) Error: Identifier not found "PValueEntA"
KOL_ansi.inc(1083,25) Error: Error in type definition
KOL_ansi.inc(1084,15) Error: Identifier not found "TValueEntA"
KOL_ansi.inc(1084,25) Error: Error in type definition
KOL_ansi.inc(1111,13) Error: Illegal expression
KOL_ansi.inc(1112,13) Error: Illegal expression
KOL_ansi.inc(1149,20) Error: Identifier not found "PDiscDlgStructA"
KOL_ansi.inc(1149,35) Error: Error in type definition
KOL_ansi.inc(1179,24) Error: Identifier not found "PUniversalNameInfoA"
KOL_ansi.inc(1179,43) Error: Error in type definition
--- End quote ---
Thaddy:
Tnx for testing. Confirms my experience in part. I will try to fix this. Manually applying -dVER2 is not enough. It should be, though.
btw I am cleaning out FPC defines (they are for the most part redundant, except windows.pas) , but that will take some more time and testing.
Btw: the missing windows functions should be covered in KOL_ANSI.inc and KOL_UNICODE.inc.
That's why I suspected a change in the parsing. This used to work with trunk until VERY recently.
rvk:
--- Quote from: Thaddy on October 31, 2015, 03:39:14 pm ---Manually applying -dVER2 is not enough. It should be, though.
--- End quote ---
Just adding a {$IFDEF VER3} isn't either, it seems :)
--- Quote ---Btw: the missing windows functions should be covered in KOL_ANSI.inc and KOL_UNICODE.inc.
That's why I suspected a change in the parsing. This used to work with trunk until VERY recently.
--- End quote ---
That's very strange. The only place I can find MakeIntAtomA in both FPC 2.6.4 and trunk is in jwawinbase.pas. And TFNFontEnumProcA isn't to be found in either. I checked all *.pas;*.pp;*.inc files with ScanFS from Saleen. A.F.A.I.K. that should cover the whole source of FPC itself. Both are also not defined in KOL itself. So I find it strange it would work in an older version of FPC.
The only way this would have worked is if the whole KOL_ANSI.inc wasn't included in KOL. But since the source hasn't changed since feb 28th and KOL_ANSI.inc is always included for IFDEF WIN this would be very strange.
In what version did it work? (Did is work in 2.6.4 for you) If so, maybe you can check where the MakeIntAtomA is taken from. You could check why it's valid in that version.
I did notice the following note of yours in the KOLDEF.INC
--- Quote ---FPC version 2.1.1 is very compatible with Delphi and kol now.
You can simply use the $(DELPHI)\source\rtl\win\*.pas files from Delphi 4/5 instead of the prepared files that were needed for FPC1.X
--- End quote ---
And yes... if you use the Windows.pas from Delphi 4/5 it will probably work. That one does have MakeIntAtomA declared in it. So my guess would be that you had the Delphi Windows.pas in your FPC source somewhere.
marcov:
Yup, the defines seems to be a horrible mess. MakeIntAtom is a macro not an api function, and how that is handle is much mover variable than for straight calls.
They violate the prime requirement, namely to never use something like {$ifdef d6higher} directly in source.
And nuggets like
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- {$DEFINE GDI} {$UNDEF LIN} {$UNDEF WIN} {$UNDEF GDI}
The source exhibits signs of "if it ain't broke, then don't fix it" mentality driven too far.
Navigation
[0] Message Index