🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #4597

Bound Checking in Pascal ( was Re: Check the Arg Count )

#4597
From: Gareth Husk
Date: Mon, 19 Jan 1987 10:42
30 lines
1963 bytes
>In article <745@drivax.UUCP> holloway@drivax.UUCP (Bruce Holloway) writes:
>
>Pascal puts in a lot of code for array overruns, etc., that are unnecessary for
>a well-designed program. You could turn all this off on the Pascal I learned
>on, which made it tolerable. But I don't want anything in the program I didn't
>put there -- if I'd wanted subscript checking, I would have added it.

I hope you use  Berkeley Pascal Bruce because it doesn't have 
complete bounds checking. I was held up for ages a few months ago
when I was trying to find this a bug that suddenly appeared after a mass
of bug fixes ( I know I should have done them one at a time ).

However what was happening was that the program was reading into a 
character array in a record, reaching the end and reading into the
next data area. The checking worked fine if the next area was an integer
or such like because a type clash error would come up. However if the
subsequent was of type char or an array of type char the program kept
on reading in with no warnings.

The bound checking may be on but don't ever take it for granted.

Gareth



-- 
" I am a doughnut "  JFK

UUCP:  ...!seismo!mcvax!ukc!dcl-cs!gareth
DARPA: gareth%lancs.comp@ucl-cs	  JANET: gareth@uk.ac.lancs.comp
Technical Details
Message-ID: <171@dcl-csvax.comp.lancs.ac.uk>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!mcvax!ukc!dcl-cs!gareth
References: <3226@bu-cs.BU.EDU> <1635@enea.UUCP> <745@drivax.UUCP> <492@gec-mi-at.co.uk>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!mcvax!ukc!dcl-cs!gareth
From: gareth@comp.lancs.ac.uk (Gareth Husk)
Newsgroups: comp.lang.misc
Subject: Bound Checking in Pascal ( was Re: Check the Arg Count )
Message-ID: <171@dcl-csvax.comp.lancs.ac.uk>
Date: Mon, 19-Jan-87 05:42:11 EST
Article-I.D.: dcl-csva.171
Posted: Mon Jan 19 05:42:11 1987
Date-Received: Wed, 21-Jan-87 02:10:31 EST
References: <3226@bu-cs.BU.EDU> <1635@enea.UUCP> <745@drivax.UUCP> <492@gec-mi-at.co.uk>
Reply-To: gareth@comp.lancs.ac.uk (Gareth Husk)
Followup-To: comp.lang.pascal
Organization: Department of Computing at Lancaster University, UK.
Lines: 30