[fpc-pascal] TP compatibility: procedural type

Karoly Balogh (Charlie/SGR) charlie at scenergy.dfmk.hu
Tue Aug 29 14:08:08 CEST 2017


Hi,

On Tue, 29 Aug 2017, Anton Shepelev wrote:

> >>  To be used as procedural values, procedures  and
> >>  functions  must  be declared with a 'far' direc-
> >>  tive or compiled in the '{$F+}' state.
> >>
> >>whereas Free Pascal in -Mtp seems  to  accept  any
> >>non-system  procedure  or function as a value of a
> >>procedural type.  Is it an instance of  TP  incom-
> >>patibilty or am I missing something?
> >
> >That  would probably be only relevant on i8086. All
> >the other targets don't  have  the  distinction  in
> >"near"  and "far", so it's not necessary to artifi-
> >cially restrict everything.
>
> But this is from the  Language  guide -- a  document
> that  descrbes  the  language in a platform-agnostic
> way, except when the contrary is  explicitly  inidi-
> cated.   Where  Turbo Pascal did not accept a proce-
> dure without the 'far' modifier, one  should  expect
> Free Pascal to reject it also in 'TP' mode.

It's documented, that Free Pascal ignores far and near directives because
they were for 16bit code, and have no meaning in 32bit or 64bit code:

https://www.freepascal.org/docs-html/user/usersu82.html

Therefore it's logical that the compiler also ignores their absence.

Although this documentation should probably be updated, because we now
support some 16bit and 8bit systems as well. But I'm pretty sure you can
find a bunch of other things, which FPC allows even in TP mode, but TP
disallows/doesn't support, just because the amount of extra features in
the language since TP was out...

Charlie



More information about the fpc-pascal mailing list