Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!world!ksr!jfw From: jfw@ksr.com (John F. Woods) Newsgroups: comp.std.c Subject: Re: call to revolt Message-ID: <4247@ksr.com> Date: 27 Jun 91 14:45:47 GMT References: <992@baby.and.nl> <1991Jun27.002412.10929@tkou02.enet.dec.com> Sender: news@ksr.com Lines: 27 diamond@jit533.swstokyo.dec.com (Norman Diamond) writes: >In article <992@baby.and.nl> jos@and.nl (J. Horsmeier) writes: >>Hi there, I'll die if casting lvals is going to be illegal. >>type* Thing; >>((int)Thing)= Thing-Base+1; >You'll die if you have to write > Thing = (type*) (Thing-Base+1); >My heart bleeds for you. Well, in fact, the second line isn't actually obligated to do what is apparently desired, i.e. to copy the integer value bit-for-bit into the pointer; the cast to a pointer is entitled to (if deemed desirable by the compiler writer) change the representation to something that the hardware would find more convenient. The problem isn't really that J. Horsmeier doesn't understand the subtleties of the language, it's that he doesn't understand the fairly gross problem of portability. To accomplish exactly what this person thinks is desired requires a union, but of course that course is still fraught with peril, because the thing being done is non-portable. The bulk programming community seems to have gone from undergraduate VAX programmers who just don't understand portability issues to geeky 8086 programmers who actively misunderstand portability; thank goodness Intel is trying to exterminate all future microprocessor architectures in favor of their washing-machine controller, or the next generation of programmers might be completely useless! :-)