home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.pascal:6830 comp.object:4298
- Path: sparky!uunet!cs.utexas.edu!sun-barr!ames!agate!doc.ic.ac.uk!uknet!mcsun!sunic!kth.se!dront.nada.kth.se!d85-jmh
- From: d85-jmh@dront.nada.kth.se (Jan-Olof Hendig)
- Newsgroups: comp.lang.pascal,comp.object
- Subject: Re: BP/TP OOP is missing something...
- Message-ID: <1992Nov23.102238.18624@kth.se>
- Date: 23 Nov 92 10:22:38 GMT
- Sender: usenet@kth.se (Usenet)
- Organization: Royal Institute of Technology, Stockholm, Sweden
- Lines: 38
- Nntp-Posting-Host: dront.nada.kth.se
-
- In article <1992Nov23.070908.141@jyu.fi> sakkinen@jyu.fi (Markku Sakkinen) writes:
- >In article <1992Nov20.135804.8752@ida.liu.se> c89ponga@odalix.ida.liu.se (kand. Pontus Gagge) writes:
- >> ...
- >>>>I would guess that good Pascal implementation may also initialise
- >>>>pointer variables to NIL so that using them before assignment
- >>>>will not cause catastrophic effects.
- >>
- >>>On a PC in "real" mode, NIL is likely the most catastrophic value to
- >> ^^^^^^^^^^^^
- >>>initialize a pointer to :-). TP doesn't initialize pointers, but at
- >>>least one TP clone (Pascal+ from Stony Brook) does.
- >>
- >>In case someone misses the implicit irony, let me point out the obvious:
- >>the best errors are those that generate the worst cataclysms. This makes
- >>them sort of hard to miss...
- >
- >IMO, it is a bad and unsafe Pascal compiler that does not support
- >the run-time detection of dereferencing NIL, even as an option.
- >I realise that such detection is too expensive on some unsophisticated
- >processor architectures to be always done.
- >
- >----------------------------------------------------------------------
- >Markku Sakkinen (sakkinen@jytko.jyu.fi)
- > SAKKINEN@FINJYU.bitnet (alternative network address)
- >Department of Computer Science and Information Systems
- >University of Jyvaskyla (a's with umlauts)
- >PL 35
- >SF-40351 Jyvaskyla (umlauts again)
- >Finland
- >----------------------------------------------------------------------
-
- Being able to detect NIL pointer dereferencing is a good reason to upgrade
- to BP7. You 'just have to recompile' your programs with target set to
- 'Protected', and then run them. All NIL pointers that are dereferenced will
- generate Runtime error 216, as will most illegal pointer operations, like
- for instance using a noninitialized pointer. Protected mode has its benefits.
-
- Jan-Olof
-