ISO 7185 mode rejects program name as duplicate
Original Reporter info from Mantis: samiam95124
-
Reporter name: Scott Franco
Original Reporter info from Mantis: samiam95124
- Reporter name: Scott Franco
Description:
The program name in the header is rejected as a duplicate on use for other ids. The ISO 7185 standard sez:
program = program-heading ' ;' program-block '.' .
program-heading = 'program' identifier [ '(' program-parameter-list ')'] .
program-parameter-list = identifier-list .
program-block = block .
The identifier of the program-heading shall be the program name. It shall have no significance within the program.
From the ISO 7185 standard at:
http://www.pascal-central.com/iso7185.html#6.10%20Programs
Steps to reproduce:
C:\projects\PASCAL\pascal-p5>fpc -Miso test.pas
Free Pascal Compiler version 3.2.0 [2020/06/04] for i386
Copyright (c) 1993-2020 by Florian Klaempfl and others
Target OS: Win32 for i386
Compiling test.pas
test.pas(3,9) Error: Duplicate identifier "test"
test.pas(7) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Error: C:\FPC\3.2.0\bin\i386-Win32\ppc386.exe returned an error exitcode
C:\projects\PASCAL\pascal-p5>cat test.pas
program test;
var test: integer;
begin
end.