[fpc-devel] Allow record helper inheritance in Delphi mode
Ondrej Pokorny
lazarus at kluug.net
Wed Sep 13 22:20:58 CEST 2017
On 13.09.2017 22:08, Sven Barth via fpc-devel wrote:
> Anyway, I had looked at your patch last Friday, but after some thinking
> I came to the conclusion that I definitely don't want the typehelpers
> modeswitch to enable inheritance on record helpers in mode Delphi cause
> that would be some unexpected sideeffect on that switch. However to
> implement this correctly I'll need to store the helper type in the PPU.
> It's nothing big, just something I need to find the time for...
Great. Thanks for the feedback. I appreciate it.
>> Btw. when you are so strict about disabling helper inheritance due to
>> Delphi compatibility why do you allow C-like operators in Delphi mode by
>> default?
>>
>> program Cop;
>>
>> {$mode delphi}
>>
>> var
>> I: Integer;
>> begin
>> I := 0;
>> I += 1;
>> end.
>>
>> ... and they even have their COPERATORS directive.
> Two things:
> 1. If you compile with -n (and -Fupath/to/rtl) you'll see that it is not
> Delphi mode that enables the C-operators, but the default fpc.cfg (and
> no, I don't know who had the idea to enable that as default; maybe it
> was originally default and then moved to a directive, but kept set by
> default using the fpc.cfg... - for this however see the next point)
This is what I thought as well. I took a look into my fpc.cfg and saw
-Sc is commented out:
# -Sc supports operators like C (*=,+=,/= and -=)
But I didn't look at the end of the section where it is defined:
-Sgic
My apologies :) But there are still inconsistences that just feel strange :/
Ondrej
More information about the fpc-devel
mailing list