[fpc-devel] $IF issues

Vincent Snijders vsnijders at quicknet.nl
Mon Aug 14 11:53:10 CEST 2006

Daniƫl Mantione schreef:
> Op Mon, 14 Aug 2006, schreef Graeme Geldenhuys:
>> On 8/14/06, Peter Vreman <peter at freepascal.org> wrote:
>>>> Is this a feature or a FPC bug?  FPC allows the $IF to be closed
>>>> with
>>>> the $ENDIF as well as the $IFEND.  This is not Delphi compatible.
>>>> The closing tag for $IF is $IFEND
>>>> The closing tag for $IFDEF is $ENDIF
> As I read it, $IF/$IFEND was added to Delphi in Delphi 6. FPC supports 
> this construction much longer, I think since the 0.9.x series. The FPC way 
> has always been to use $ENDIF and FPC will of course not break 
> compatibility with itself. Go ask Borland why they wanted to be FPC 
> incompatible :)
>>> Feature.
>> Maybe this should be controlled by the compiler mode?  Delphi vs
>> ObjFPC.  Or should we leave it up to the developer to remember which
>> one to use when writing code to be compiled with Delphi and FPC?
> You could make it dependent on the compiler mode, but I don't see the 
> point, any Delphi code will still compile.

You miss the point: Delphi compatibility mode is for people who develop for FPC, but 
want to compile occasionally in Delphi. In the current situation they are not aware 
of this weakness of Delphi (no support of $ENDIF for $IF), until they compile in 
Delphi. But maybe Graeme should make a Delphi feature request too (and see which is 
honoured first) :-)


More information about the fpc-devel mailing list