Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!ames!ucbcad!ucbvax!decvax!tektronix!uw-beaver!tikal!sigma!uw-nsr!john From: john@uw-nsr.UUCP Newsgroups: comp.arch Subject: Re: catering to bad code Message-ID: <954@uw-nsr.UUCP> Date: Fri, 20-Feb-87 00:33:15 EST Article-I.D.: uw-nsr.954 Posted: Fri Feb 20 00:33:15 1987 Date-Received: Sat, 21-Feb-87 06:00:56 EST References: <14833@amdcad.UUCP> Reply-To: john@uw-nsr.UUCP (John Sambrook 5-7433) Organization: UW-Bioengineering, Seattle, WA Lines: 54 In article <14833@amdcad.UUCP> phil@amdcad.UUCP (Phil Ngai) writes: >In a Unix system I am designing, I am considering catering to bad >code. That is, like the VAX I propose to make location 0 contain a >readable 0. I think that code which gets ported to a Sun machine often >has to have this kind of thing cleaned up. Well, I think I can comment on this. For the last couple of years I have been (marooned) on a Data General MV/10000 system. As many of the readers of this newsgroup are probably aware this system has different hardware representations for "byte" pointers and "word" pointers. They also have "bit" pointers, but never having had to use one I really can't comment on them. I have seen postings from Steve Wallach in this newsgroup from time to time. I hear he knows something about MV's :-) At any rate it has been my experience that something like 70 - 80 % of the C programs I have ported have had pointer problems. There are a few exceptions to the rule, for example XLISP, rn and mkmf. Many of the programs that I have ported have tried to dereference through NULL. On the MV series this does not work, at all. However a much larger number of C programs are sloppy and don't cast pointer types appropriately. On the MV series this causes a protection violation and you are left looking at a few lines of traceback information. >What do people think of this? Is it kind of disgusting? No comment. I could vote either way right about now. >Just how much code has this problem? Did every program you ported to a >Sun have to be fixed, or 10%, or something in between? Too much code has this problem. However, there are people working on correcting the bad programs. I guess they will eventually die out, although not soon enough for me. However, only a couple of weeks ago my boss asked me how much work it would be to get "refer" running on our system. Aack! >I'd like to do things right, but I'm also lazy. I think doing this >will save me a lot of work. Have I overlooked anything? The processor >has a relocatable vector area so I can easily map the vector table >somewhere else. It would have saved me a lot of work. To be fair to Data General, they have developed (probably in self- defense) a top-notch C compiler that is very good at finding problems with pointer type mismatches and subscript range errors. To be fair to me they still don't have a dbx that can be used for serious debugging. -- John Sambrook Work: (206) 545-7433 University of Washington WD-12 Home: (206) 487-0180 Seattle, Washington 98195 UUCP: uw-beaver!uw-nsr!john