home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!charnel!psgrain!m2xenix!agora!robart
- From: robart@agora.rain.com (Joe Bob)
- Newsgroups: comp.lang.modula2
- Subject: Re: Generic stack implementation
- Message-ID: <C0qHEG.F5t@agora.rain.com>
- Date: 12 Jan 93 09:08:37 GMT
- References: <36764.2B50C7C5@puddle.fidonet.org> <1993Jan11.171245.1@wombat.newcastle.edu.au>
- Organization: a gora
- Lines: 17
-
- In article <1993Jan11.171245.1@wombat.newcastle.edu.au> eepjm@wombat.newcastle.edu.au (Peter Moylan) writes:
- >In article <36764.2B50C7C5@puddle.fidonet.org>, Robert.Barton@p0.f6.n105.z1.fidonet.org (Robert Barton) writes:
- >>
- >> Why is type-casting non-portable?
- >
- >Try this:
- > VAR c: CARDINAL; p: POINTER TO something;
- > ...
- > c := CARDINAL(p);
- >
- >It will work on machines for which a CARDINAL and a POINTER take the
- >same amount of memory, but not on others.
-
-
- It won't work in that case because it's not a valid cast, since the
- sizes of the objects aren't equal. Of course if TSIZE(ADDRESS) does
- not equal TSIZE(CARDINAL) then it is also non-Wirthian.
-