TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Wim Veldhuis
from: Jonathan de Boyne Pollard
date: 1994-11-25 05:06:18
subject: 16-Bit To 32-Bit Callbac

ZZ>
  > I think this is bad. It breaks the rule that a typecast
  > does not alter the actual bytes, just the interpretation of
  > them.
ZZ>

  Actually, there is no such rule.  A type cast is free to alter the
  value of an expression.  One of the more prevalent examples that
  breaks this "rule" is casting from pointer to integer and back again.
  There is no guarantee that the end result will equal the original
  pointer.

  It is not even guaranteed in Standard C that all integers can be cast
  to pointers without causing a program exception, or other undefined
  behaviour.

  So casting from a 0:32 pointer to a 16:16 pointer breaks no rule.

ZZ>
  >       If CSet does this it would almost surely mean that
  > the code you produced is non-portable, even not to another
  > compiler on the same platform !
ZZ>

  That's a bit of a non-issue, since thunking is by its very nature a
  platform specific thing.  It doesn't really make sense to worry about
  the portability of thunking.

  > JdeBP <
___
 X MegaMail 2.10 #0:DF> I repeat....  Huh ?

--- Maximus/2 2.02

* Origin: DoNoR/2,Woking UK (01483-725167) (2:440/4)
SEEN-BY: 12/2442 54/54 620/243 624/50 632/348 640/820 690/660 711/409 410 413
SEEN-BY: 711/430 807 808 809 934 942 949 712/353 623 713/888 800/1
@PATH: 440/4 141/209 270/101 396/1 3615/50 229/2 12/2442 711/409 54/54
@PATH: 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.