[comp.lang.misc] Bound Checking in Pascal

gareth@comp.lancs.ac.uk (Gareth Husk) (01/19/87)

>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