Am 29.08.2017 14:26 schrieb "Anton Shepelev" <anton....@gmail.com>: > > Karoly Balogh to Anton Shepelev: > > >>According to Borland's official language guide to > >>Turbo Pascal 7.0, > >> > >> To be used as procedural values, procedures and > >> functions must be declared with a 'far' directive > >> 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 incompat- > >>ibilty or am I missing something? > > > >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 ig- > >nores their absence. > > Ignoring them in the sense of not affecting the gen- > erated machine code is perfectly OK, but not requir- > ing their presence in the source, to make the pro- > gram compilable in Turbo Pascal, seems wrong when > Free Pascal is in Turbo Pascal mode. A program that > Free Pascal compiles successfully in TP mode should > work with the actual Turbo Pascal compiler. Is it > not the purpose of these modes? Do they guarranty > only forward-compatibility?
The modes are for the case have code written for other compilers (TP, MacPas, Delhi, ISO) work in FPC (as good as reasonably possible). We do however *not* guarantee that code written in one of these modes with FPC compiles or runs with the corresponding compiler. Regards, Sven
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal