View Issue Details

IDProjectCategoryView StatusLast Update
0037739FPCCompilerpublic2020-09-12 10:05
ReporterKai Burghardt Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Platformx86_64OSGNU/Linux 
Product Version3.2.0 
Summary0037739: {$mode ISO} accepts Extended Pascal block as a block
DescriptionIn ISO 7185 a block consist of

1. exactly one optional label-section,
2. exactly one optional const-section,
3. exactly one optional type-section,
4. exactly one optional var-section
5. optionally routine declarations and definitions
6. exactly one compound statement

in _that_ order. Confer http://pascal-central.com/iso7185.html#6.2.1%20Blocks
Steps To ReproduceHowever, the following program is accepted, but should fail to compile, because it is out of order:

{$mode ISO}
program blocks(input, output);

procedure foo;
begin
    writeLn('Hi!');
end;

var
    x: integer;

type
    r = record end;

const
    answer = 42;

begin
end.
Additional InformationIn Extended Pascal, ISO 10206, this restriction is lifted. There, in EP, can be as many sections and routine declaration/definitions parts as necessary, and they can occur in any order, as long as there is _one_ compound statement at the end.
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2020-09-12 02:03 Kai Burghardt New Issue