[fpc-devel] Why: "Can't take the address of constant expressions" here?

wkitty42 at windstream.net wkitty42 at windstream.net
Fri Jan 13 10:52:59 CET 2023


On 1/12/23 10:29 AM, Mattias Gaertner via fpc-devel wrote:
> On Wed, 11 Jan 2023 23:58:34 +0100
> Bart via fpc-devel <fpc-devel at lists.freepascal.org> wrote:
[...]
>> begin
>>    with WideStringManager do
>>    begin
>>      writeln(1);
>>      Wide2AnsiMoveProc(pwidechar(WSource),RawByteString(ADest),
>> CP_UTF8, Length(WSource));
>>      writeln(2);
>>      Ansi2WideMoveProc(PChar(ASource), CP_UTF8, UDest,
>> Length(ASource));   //<< test.lpr(24,53) Error: Can't take the address
>> of constant expressions (caret behind UDest)
>> end.
> 
> First of all, adding a 'end;" for the "with" compiles under Linux.
> That's because widestring=unicodestring on Linux.

i'm a little surprised there is no "mismatched begin/end" error with the caret 
pointing to the 2nd begin...

-- 
  NOTE: No off-list assistance is given without prior approval.
        *Please keep mailing list traffic on the list where it belongs!*


More information about the fpc-devel mailing list