Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ut-sally!husc6!rutgers!cbmvax!daveh From: daveh@cbmvax.cbm.UUCP (Dave Haynie) Newsgroups: comp.emacs Subject: Re: (none) Message-ID: <1502@cbmvax.cbmvax.cbm.UUCP> Date: Fri, 6-Mar-87 04:19:49 EST Article-I.D.: cbmvax.1502 Posted: Fri Mar 6 04:19:49 1987 Date-Received: Sun, 8-Mar-87 06:20:48 EST References: <8703050701.AA02834@sun.Sun.COM> Organization: Commodore Technology, West Chester, PA Lines: 47 > i'm having a heck of a time porting GNU Emacs to a 286 running > System V. the problem stems largely from the fact that an int > is not the same size as a (char *). the GNU code makes this > general assumption, and it's probably is correct for any machine, > except for a '286. > > do you know of anyone who has a port of GNU to such a system?? also, > we have a few '386 systems running System V... This again! ARRGH! This keeps popping up in C sources written by folks who really should know better. The thing is that "int" is best defined as an integer that best matches the "natural" size of the machine-in-question's word. While the (char *) is obviously a pointer and will match the machine-in-question's address size (excluding any weird things that happen on segmented machines like 8088 based PCs with large memory models. That might actually be a boon for C language writers, 'cause on a setup like that, you've absolutely GOT to ask for a pointer if you want a pointer, as a pointer reference is basically a subroutine call, not a simple memory reference). Anyway, we've run into the same problems on an Amiga (68000 based), which probably has some properties in common with the native mode 80286. The 68000 has a 16 bit data path, three 16 bit ALUs, but 32 bit registers and a 24 bit (32 for upward compatibility) address length. So what's the natural size for "int"? Aztec has decided that its 16 bits, but they give you the option to compile with 32 bit "int"s for compatibility with sloppily written programs being ported from 100% 32 bit machines. Lattice has decided that the natural word size is really 32 bits, so all "int" operations are 32 bit operations. Because of this (never bothered me when I was writing code on these nice 32 bit VAXen), I now ALWAYS ask for a "short", "long", "char *" or whatever, when I really want that. The UNIX PCC is too relaxed about type coercions to do anything that will promote ease of porting; Lattice on the Amiga supports some of the ANSI stuff that says "yell if the types aren't exactly the same", though, unfortunately, its a bit late for all of this VAX UNIX based stuff everyone wants to port to their larger micros. -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ __ ____ ____ _____ _____ _____ Dave Haynie /// / _ | / __ \ / _ \ / _ \ / _ \ Commodore Technology /// / / | | /_/ | | | | | | | | | | | | | | |\ /// / /__| | ____/ | | | | | | | | | | | | | |\\/// / ____ | / ____/ | | | | | | | | | | | | \\// / / | | | |____ | |_| | | |_| | | |_| | {ihnp4,etc.}!cbmvax!daveh \/ /_/ |_| \______| \_____/ \_____/ \_____/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~