Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 (Fortune 01.1b1); site graffiti.UUCP Path: utzoo!linus!decvax!ucbvax!ucdavis!lll-crg!seismo!ut-sally!ut-ngp!shell!graffiti!peter From: peter@graffiti.UUCP (Peter da Silva) Newsgroups: net.micro.atari Subject: Re: ST programs without AES & VDI? Message-ID: <312@graffiti.UUCP> Date: Wed, 16-Oct-85 10:23:10 EDT Article-I.D.: graffiti.312 Posted: Wed Oct 16 10:23:10 1985 Date-Received: Mon, 21-Oct-85 06:33:53 EDT References: <10613@ucbvax.ARPA> <558@riccb.UUCP> Distribution: net Organization: The Power Elite, Houston, TX Lines: 19 > You also have to be careful when passing arguments because the C compiler > does not automatically convert everything to long words when passing arguments > on the stack. chars and ints use MOV.W data,(SP)- and pointers and longs > use MOV.L data,(SP)-. This can can a crash due to bus errors because if > you're not careful you could pick up an invalid pointer. > > Don't ask me why they decided to do it this way, probably just to cut down > on generated code and improve speed, but it definately will cause problems > with LOTS of software that assumes that arguments passed to function are > the same size and resized to the proper size by the called function. There is certainly precedent for this sort of thing: the original Ritchie compiler did things this way. If your code assumes that int promotes to long or to (void*) on a function call it will die on more machines than just this one. Now why they didn't follow the VAX' precedent and make ints 32 bits, and shorts 16 bits, I don't know. Are you sure that the compiler uses 16-bit ints? Strikes me as silly on a 68000.