[fpc-devel] $MODE DELPHI quirks

Thaddy thaddy at thaddy.com
Tue Nov 29 15:39:57 CET 2011


I ran into my own problem when writing a program in freepascal that also 
should compile in Delphi (don't ask)
Logically you would expect $mode delphi to enforce delphi compatibility 
at the sourcecode level.
But this is not the case if f.e. C style operators are used or 
specified, or macro's.
I accidentally used the former in my code.
Shouldn't it be better if compatibility is enforced both ways?

I am sure this would have been discussed before.
Shouldn't the compiler at least generate  a hint or possibly a warning, 
when non-delphi compatible syntax is used in delphi mode?
Or with a bit more logic, shouldn't those options be excluded by $mode 
delphi and -Mdelphi?

Or if this is inconvenient something like $mode strictdelphi?

Thaddy



More information about the fpc-devel mailing list