Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbvax.BERKELEY.EDU Path: utzoo!watmath!clyde!burl!ulysses!ucbvax!sun.arpa!nagler%orb From: nagler%orb@SUN.ARPA (Rob Nagler) Newsgroups: net.lang.mod2 Subject: Re: extensions, a modest question Message-ID: <8603220125.AA24674@orb.sun.uucp> Date: Fri, 21-Mar-86 20:25:56 EST Article-I.D.: orb.8603220125.AA24674 Posted: Fri Mar 21 20:25:56 1986 Date-Received: Sat, 22-Mar-86 23:05:44 EST Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 15 I believe that dereferencing a type cast is a bad idea. This is just like case variant records, but messier. You should only need to do this type of stuff in a very few places and having to do something grungy (like untagged variant records) will flag the few places with a blazing mark to all who read the code. If you make it too easy to type cast and do other illicit deeds, I think programmers will take advantage far too often. Here is a random example from C: in_lnaof(((struct sockaddr_in *)&ifinet->if_addr)->sin_addr) Yes, this is actual code that took me about 3 minutes to find in the 4.2 UNIX kernel. I happen to know where the real bad parts are..... Rob