#1 2017-10-09 14:13:50

mwore
Member
Registered: 2017-09-15
Posts: 5

SynCommons.ExistsIniName endless loop (Delphi 2010 comp. warning)

I'm getting a bunch of compilation warnings inside SynCommons with Delphi 2010 and the latest nightly build (happened in older builds too). The most problematic warning happens during ANSICHARNOT01310 assignment: [DCC Warning] SynCommons.pas(13183): W1061 Narrowing given WideChar constant (#$00FF) to AnsiChar lost information.

Consequently ExistsIniName function goes into an endless loop while trying to check for "ORIGIN:" inside HTTP request header. The problem is actually inside GetNextLineBegin which stops advancing through request header once is hits 'z' because ANSICHARNOT01310 is defined as [#1..#9,#11..#12,#14..'y'].

This only happens when I clear all DCU files from the project and compile for the first time. However if I change anything inside SynCommons, which will recompile it again, it starting working perfectly and ANSICHARNOT01310 is now defined correctly as [#1..#9,#11..#12,#14..'˙'].

Any idea how to fix this without compiling twice?

Thanks!

Offline

#2 2017-10-09 16:12:12

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,966
Website

Re: SynCommons.ExistsIniName endless loop (Delphi 2010 comp. warning)

Are you using the latest version of the framework?
Current revision is 1.18.3878.

I don't have Delphi 2010 installed here...

Offline

#3 2017-10-09 16:25:08

mwore
Member
Registered: 2017-09-15
Posts: 5

Re: SynCommons.ExistsIniName endless loop (Delphi 2010 comp. warning)

Yes, I just downloaded the latest build (1.18.3878) and it shows the same warnings ...

[DCC Warning] SynLZ.pas(1348): W1061 Narrowing given WideChar constant (#$00FF) to AnsiChar lost information
[DCC Warning] SynCommons.pas(13219): W1061 Narrowing given WideChar constant (#$00FF) to AnsiChar lost information
[DCC Warning] SynCommons.pas(21714): W1062 Narrowing given wide string constant lost information
[DCC Warning] SynCommons.pas(36704): W1061 Narrowing given WideChar constant (#$00FF) to AnsiChar lost information
[DCC Warning] SynCommons.pas(51643): W1061 Narrowing given WideChar constant (#$0080) to AnsiChar lost information
[DCC Warning] SynCommons.pas(53756): W1061 Narrowing given WideChar constant (#$00C8) to AnsiChar lost information
[DCC Warning] SynCommons.pas(54234): W1061 Narrowing given WideChar constant (#$00FF) to AnsiChar lost information
[DCC Warning] SynCommons.pas(54237): W1061 Narrowing given WideChar constant (#$00FF) to AnsiChar lost information
[DCC Warning] SynCommons.pas(59524): W1061 Narrowing given WideChar constant (#$00FE) to AnsiChar lost information
[DCC Warning] SynCommons.pas(59532): W1061 Narrowing given WideChar constant (#$00FF) to AnsiChar lost information
[DCC Warning] SynCommons.pas(66206): W1061 Narrowing given WideChar constant (#$0080) to AnsiChar lost information
[DCC Warning] mORMot.pas(25600): W1062 Narrowing given wide string constant lost information
[DCC Warning] mORMot.pas(25600): W1062 Narrowing given wide string constant lost information

Offline

#4 2017-10-09 16:30:23

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,966
Website

Re: SynCommons.ExistsIniName endless loop (Delphi 2010 comp. warning)

I don't have those warning with latest (XE4+) revisions...

Offline

#5 2017-10-09 16:44:29

mwore
Member
Registered: 2017-09-15
Posts: 5

Re: SynCommons.ExistsIniName endless loop (Delphi 2010 comp. warning)

The warnings disappear when I change something (like a blank space) in SynCommons and compile again. It works perfectly after that.
Seems like SynCommons depends on a precompiled unit which isn't there when the whole Synopse gets compiled for the first time. I'm not that familiar with the inner-workings of Delphi so I could be completely wrong.

However, I have tried to do that a couple of times today and it's always the same result:
- Clear all DCUs from project
- Compile whole project
- Run
- Test - doesn't work because it goes into an endless loop inside ExistsIniName
- Change a white space in SynCommons
- Compile again
- Run
- Test - works perfectly

Offline

Board footer

Powered by FluxBB