Duplicate case label error
Hello @synopse,
compiling the file mormot.core.os.security.pas with Delphi XE2 Professional gives the error Duplicate case label at line 3334 where there is the label #$80 .. #$ff:.
It is weird, I can not duplicate the issue here with Delphi XE2:
***** mORMot 2 integration using Delphi XE2 for Win32 *****
d:\dev\lib2\test
Embarcadero Delphi for Win32 compiler version 23.0
Copyright (c) 1983,2011 Embarcadero Technologies, Inc.
518680 lines, 3.84 seconds, 6550584 bytes code, 332344 bytes data.
***** mORMot 2 integration using Delphi XE2 for Win64 *****
d:\dev\lib2\test
Embarcadero Delphi for Win64 compiler version 23.0
Copyright (c) 1983,2011 Embarcadero Technologies, Inc.
522997 lines, 16.88 seconds, 7806480 bytes code, 675156 bytes data.
Hi, thanks for the reply.
The error comes up when I try to compile a project of mine that uses the mormot.crypt.core unit.
These are the error messages that appear during compilation:
D:\Delphi\mORMot2\src\core\mormot.core.os.security.pas(3334) warning : W1061 Narrowing given WideChar constant (#$0080) to AnsiChar lost information
D:\Delphi\mORMot2\src\core\mormot.core.os.security.pas(3334) error : E2030 Duplicate case label
D:\Delphi\mORMot2\src\core\mormot.core.os.security.pas(3370) error : E2030 Duplicate case label
D:\Delphi\mORMot2\src\core\mormot.core.os.security.pas(3377) error : E2030 Duplicate case label
D:\Delphi\mORMot2\src\core\mormot.core.rtti.pas(877) Fatal: F2063 Could not compile used unit 'mormot.core.os.security.pas'
Done Building Project "D:\Projects\MyProj.dproj" (Rebuild target(s)) -- FAILED.
Are they perhaps dependent on the first warning (W1061)? Can you help me understand where the problem lies? Thank you very much.
Hi,
I found out the cause of the error.
My project also uses superobject and somewhere in the superobject sources the compiler directive HIGHCHARUNICODE is turned on. This causes the warning W1061 and the resulting duplicate case label error when compiling my project.
However, I have seen that by modifying in mormot.core.os.security.pas (function SddlNextOperand) the case labels from this:
...
'A' .. 'Z',
'a' .. 'z',
#$80 .. #$ff:
begin
...
to this:
...
'A' .. 'Z',
'a' .. 'z',
#$80,
#$81 .. #$ff:
begin
...
the compilation is successful, without any error. For the moment I used this solution as a workaround.
Please try with my commit above, and report any issue, or close the topic. ;)
Problem solved, thanks for the support.