From: utzoo!decvax!genradbo!mitccc!zrm Newsgroups: net.unix-wizards Title: Re: Information on Unix/Vax peculiarities Article-I.D.: mitccc.199 Posted: Mon Nov 29 09:59:21 1982 Received: Wed Dec 1 05:54:04 1982 References: rabbit.943 You really do want ints to be as big as pointers, and, in fact, only as big as pointers. The main reason I can think of off the top of my head is that you want to be able to subscript a pointers over the whole address space that that pointer is in. On 32 bit machines this means 2^32 bytes. It would be very difficult to rejig pointer arithmetic and its interface to normal arithmetic so that different size objects could be used in each. The one compiler that I have worked with that has 16 bit ints and 32 bit pointers has grotesquely broken pointer arithmetic. Also, C has enough different datatypes so as to accomodate both the "natural" sizes for ints and pointers across different machines and let the programmer insure that objects that have to be of a certain size are that size. I use defined types to maintain portability from pdp11s to 68000s. Specifically, if I need a 32 bit quantity I define a type LONGWORD. On the 11 and the 68000 it looks like this: typedef LONGWORD long; But if I need a 16 bit quantity, and need to use it in portable code, the typedefs go like this: #ifdef PDP11 typedef WORD int; #else #ifdef 68000 typedef WORD short; This also localizes the program's machine dependence. And speaking of C compilers, does anyone know of a good compiler for the PDP10? Cheers, Zig