[fpc-pascal] Procedural parameters

Michael Van Canneyt michael at freepascal.org
Sun Dec 15 18:28:07 CET 2024



On Sun, 15 Dec 2024, Adriaan van Os via fpc-pascal wrote:

> Michael Van Canneyt via fpc-pascal wrote:
>> 
>> 
>> On Sat, 14 Dec 2024, Adriaan van Os via fpc-pascal wrote:
>> 
>> It's not because something is in the pascal standard, that FPC has it.
>
> It is. Appendix D6 of the Programmer's Reference says
>
> 	"This mode is selected by the $MODE ISO switch. On the command line, 
> this mode is selected by
> the -Miso switch. In this mode, the compiler complies with the requirements 
> of level 0 and level 1
> of ISO/IEC 7185."

Let's examine that statement for a second.

In my copy of the standard, section "6.1.3 Identifiers" starts with: 
"Identifiers can be of any length."

This is not implemented in FPC: identifiers are max 255 chars.

Section "6.1.4 Directives" states:
"The only directive shall be the required directive 'forward'"

But you can also pefectly compile in ISO mode

procedure a; cdecl; forward;

One can use semantic tricks and say that 'cdecl' is a modifier,
unfortunately then still the above violates the syntax diagram in section 6.6.2, 
which leaves no room for 'modifiers'.

But either FPC follows the standard to the letter (that is why it is a standard), or
it does not.

Both examples show that in the strict sense, FPC does not follow the
standard, even in ISO mode. Probably more examples can be found.

For the quoted text to be painstakingly correct, the manual text should 
better be phrased as "The compiler tries to comply with..."

The alternative is that we're a little more flexible in our interpretation of
standards and manuals or messages on this list, and then we accept that there 
may be extra or missing things in either standard and/or implementation.

Which I paraphrased loosely as: 
"It's not because something is in the pascal standard, that FPC has it."

Michael.


More information about the fpc-pascal mailing list