Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site watdaisy.UUCP Path: utzoo!watmath!watdaisy!ndiamond From: ndiamond@watdaisy.UUCP (Norman Diamond) Newsgroups: net.lang.c Subject: Re: sizeof Message-ID: <6949@watdaisy.UUCP> Date: Mon, 11-Feb-85 15:11:29 EST Article-I.D.: watdaisy.6949 Posted: Mon Feb 11 15:11:29 1985 Date-Received: Tue, 12-Feb-85 04:53:22 EST References: <8006@brl-tgr.ARPA> <110@gitpyr.UUCP> Organization: U of Waterloo, Ontario Lines: 44 > I don't have difficulty with it [various sizes of pointers], but I do > feel that all pointers should be the same size. A pointer is a pointer, > regardless of what it points to. It's a datatype all by itself; it isn't > a mutation of the datatype it points to. > > Perhaps an addition to the language is in order (gotta have something to > handle those Intel chips). Well, since C allows you to have 'long int', > 'int' and 'short int', what about long pointers, pointers and short pointers? > Don't ask me how they would be declared; I'll leave that up to someone > else. > -- Robert Viduya Then no one will know when to declare a long pointer or short pointer. They know they need a (struct xxx *) or a (char *), they should have a compiler that's bright enough to figure out whether a long pointer or short pointer is needed, for each machine they want to run their program on. In PL/I, a pointer is a datatype all by itself. On some machines, in order to be able to "point" to either integers or characters, you have to waste 3/4 of the memory your strings are stored in, and you can't use the machine's string instructions. On Intel, you can make all pointers the same size by using long pointers for everything, whether they're needed or not. Or, you can use a language that has a little bit of flexibility, and lets the compiler figure out such things. These are the reasons that Pascal, despite all of its shortcomings, is more portable in some ways than C is. People in net.lang.pascal are complaining about the same things, not being able to assign pointers to ints. Sure, let's reduce the portability of every existing language, and give more jobs to portability and languages people so that they can repeat the cycle, eh? -- Norman Diamond UUCP: {decvax|utzoo|ihnp4|allegra|clyde}!watmath!watdaisy!ndiamond CSNET: ndiamond%watdaisy@waterloo.csnet ARPA: ndiamond%watdaisy%waterloo.csnet@csnet-relay.arpa "Opinions are those of the keyboard, and do not reflect on me or higher-ups."