Path: utzoo!attcan!uunet!tektronix!reed!psu-cs!kirkenda From: kirkenda@psu-cs.UUCP (Steve Kirkendall) Newsgroups: comp.os.minix Subject: Re: Minix/ST problems. Message-ID: <1187@psu-cs.UUCP> Date: 3 Nov 88 01:18:00 GMT References: <249@cstw01.UUCP> <2598@sultra.UUCP> <397@zinn.MV.COM> Reply-To: kirkenda@psu-cs.UUCP (Steve Kirkendall) Organization: Dept. of Computer Science, Portland State University; Portland OR Lines: 30 In article <397@zinn.MV.COM> mem@zinn.MV.COM (Mark E. Mallett) writes: >In article <2598@sultra.UUCP> dtynan@sultra.UUCP (Der Tynan) writes: >>Hmmm. I've always been partial to the idea that sizeof(char *) == sizeof(int). >>In fact, I've seen a lot of code (not necessarily my own), which assumes this. >>If one needs sizeof(int) == 16, then use short. It's my belief that if you >>have a true 32-bit address space (lucky you), then there's no reason to keep >>ints to a small size. > >Of course it doesn't matter what you're partial to your what you're >beliefs are, what matters is the language definition and the compiler >implementation. The only assumption you should make about an int is that >it is a size that is optimally handled by your hardware, and sometimes >that assumption is at the whim of the compiler writer Sure, *I* write good, portable code. Anybody who does a lot of MINIX coding will have to learn to be careful, and that ain't all bad. Unfortunately, there are some people in this world who don't... so some highly desirable programs are going to be tough to port to MINIX/ST. One painful example: GCC. The author (Stallman) allowed a lot pointer/int confusion to creep into his code, so now, to get gcc running under MINIX/ST somebody is going to have to dig through (I'm guessing here) about 70,000 lines of code. BTW, there's more to the issue of pointer/int confusion than just the size of the data objects. You also have to worry about the convention that the compiler uses for returning values from functions. For example, ints might be returned in D0 while pointers are returned in A0. If your code confuses pointers and integers, you are assuming not only that they are the same size, but also that they use the same register for returning values.