🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.pascal
Article #291

SUN pascal

#291
From: Philip Budne
Date: Mon, 05 May 1986 22:39
46 lines
1291 bytes
Transposrting some pascal code from a BSD4.2 system to a SUN3.0 system
I ran into some range check problems.  The first would appear to be
an actual error (in the ISO defintion), and the other a SUN pascal
bug.

-----
program q(input,output);

var
	a : 0 .. 100;
	i : integer;

begin
	i := 0;
	for a := 0 to i-1 do
		writeln(output, a);
end.
-----
program z;

var
	c : char;
	i : -128 .. 127;

begin
	i := 10;
	c := chr( i );
end.
-----

For more entertainment I tried the same programs under TOPS-20/Rutgers
and VMS v4 pascal:

	q	z
TOPS	err	ok
SUN	err	err
BSD	ok	ok
VMS	ok	ok


The range violation in Z clearly a SUN bug, but Q would
appear to be implementation dependant, it all depends
on when you perform the range check (and if you check the
loop limits before you start).

Phil Budne / Boston University / Distributed Systems
Technical Details
Message-ID: <557@bu-cs.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!linus!philabs!cmcl2!harvard!bu-cs!budd

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!linus!philabs!cmcl2!harvard!bu-cs!budd
From: budd@bu-cs.UUCP (Philip Budne)
Newsgroups: net.lang.pascal
Subject: SUN pascal
Message-ID: <557@bu-cs.UUCP>
Date: Mon, 5-May-86 18:39:38 EDT
Article-I.D.: bu-cs.557
Posted: Mon May  5 18:39:38 1986
Date-Received: Thu, 8-May-86 07:06:33 EDT
Organization: Boston Univ Comp. Sci.
Lines: 46