home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / modula2 / 1654 < prev    next >
Encoding:
Internet Message Format  |  1993-01-12  |  1.0 KB

  1. Path: sparky!uunet!olivea!charnel!psgrain!m2xenix!agora!robart
  2. From: robart@agora.rain.com (Joe Bob)
  3. Newsgroups: comp.lang.modula2
  4. Subject: Re: Generic stack implementation
  5. Message-ID: <C0qHEG.F5t@agora.rain.com>
  6. Date: 12 Jan 93 09:08:37 GMT
  7. References: <36764.2B50C7C5@puddle.fidonet.org> <1993Jan11.171245.1@wombat.newcastle.edu.au>
  8. Organization: a gora
  9. Lines: 17
  10.  
  11. In article <1993Jan11.171245.1@wombat.newcastle.edu.au> eepjm@wombat.newcastle.edu.au (Peter Moylan) writes:
  12. >In article <36764.2B50C7C5@puddle.fidonet.org>, Robert.Barton@p0.f6.n105.z1.fidonet.org (Robert Barton) writes:
  13. >> 
  14. >>   Why is type-casting non-portable?
  15. >
  16. >Try this:
  17. >    VAR c: CARDINAL;  p: POINTER TO something;
  18. >    ...
  19. >    c := CARDINAL(p);
  20. >
  21. >It will work on machines for which a CARDINAL and a POINTER take the
  22. >same amount of memory, but not on others.
  23.  
  24.  
  25.   It won't work in that case because it's not a valid cast, since the
  26. sizes of the objects aren't equal.  Of course if TSIZE(ADDRESS) does
  27. not equal TSIZE(CARDINAL) then it is also non-Wirthian.
  28.