Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!brl-tgr!ron From: ron@brl-tgr.ARPA (Ron Natalie) Newsgroups: net.lang.c Subject: Re: lint, pointers, 0 (what else?) Message-ID: <8213@brl-tgr.ARPA> Date: Sun, 10-Feb-85 22:19:55 EST Article-I.D.: brl-tgr.8213 Posted: Sun Feb 10 22:19:55 1985 Date-Received: Tue, 12-Feb-85 05:57:44 EST References: <366@harvard.ARPA> <8094@brl-tgr.ARPA> <374@harvard.ARPA> Distribution: net Organization: Ballistic Research Lab Lines: 33 > > Looking at my assembly language programs, I find that I end up doing > 95% of all operations with one data type: address (here meant to refer > to the integer type that can hold an address, i.e. 32bits on a 68000). > Maybe 4% are done with characters, and the remaining 1% with other > types. I would be perfectly happy with a systems programming language > that has only one data type: address. Such languages exist and are > moderately successful. Unfortunatly, they are not widely available in > the UN*X world or on micros. > You obvously don't work on a diverse enough collection of machines. Some machines have readically different types of "address" depending on the data type. However, several of the propositions by the C standards will solve these problems. The bottom line pointer (void *) can replace any need to try to stick a pointer into an integer. As you state, a lot of work is done handling a type called "address." Well (void *) is an attempt to implement this witout warping the semantics of the language too much. In addition, it wouldn't require any needless restraints on what "int" is just because pointers are an odd size on this machine. The other problem involves the use of 0. Legally you are supposed to be able to assign the constant 0 to a pointer and compare a pointer to zero. But if you try to pass zero to a function expecting a pointer, it gets passed as int. The function argument typing will solve this problem as well. See, problem solved. It's been solved, and these language features were already fought over and accepted. -Ron