Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!orsvax1!pyrnj!caip!cbmvax!higgin From: higgin@cbmvax.cbm.UUCP (Paul Higginbottom) Newsgroups: net.micro.amiga Subject: Re: Problems with compiling using 16-bit ints (MANX C) Message-ID: <225@cbmvax.cbmvax.cbm.UUCP> Date: Sun, 11-May-86 18:05:19 EDT Article-I.D.: cbmvax.225 Posted: Sun May 11 18:05:19 1986 Date-Received: Tue, 13-May-86 03:29:33 EDT References: <8605102156.AA03379@cory> Reply-To: higgin@cbmvax.UUCP (Paul Higginbottom) Organization: Commodore Technology, West Chester, PA Lines: 21 In article <8605102156.AA03379@cory> dillon@CORY.BERKELEY.EDU.UUCP writes: > > The most common problem is really not the compiler's fault. Many >of you all assume integers are the same size as pointers, and do things like: > > win = (struct Window *)OpenWindow() ... > > This is incorrect. If the compiler uses 16-bit integers, and since >OpenWindow() returns an integer, you will loose the MSB word of the >returned value when it is converted to a pointer. The proper way to do >the call is: > > extern struct Window *OpenWindow(); > > win = OpenWindow(); >.... Sounds like there's an echo in this net (net, net, net...) Paul D Higginbottom (on cbmvax)