Date: Thu, 8 Jan 1998 17:04:58 +0200 (IST) From: Eli Zaretskii To: Cesar Scarpini Rabak cc: David Eberhard , djgpp AT delorie DOT com Subject: Re: problem with memory allocation (I think) In-Reply-To: <1.5.4.32.19980108122547.006b6e94@dce03.ipt.br> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Thu, 8 Jan 1998, Cesar Scarpini Rabak wrote: > At 11:00 08/01/98 +0200, Eli Zaretskii wrote: > >Also, please note that it is usually a bad idea to put a long into a > >buffere which was malloc'ed for int's, like you do: > > > > long i; > > unsigned int *buffer; > > ... > > buffer[i] = i; > > > >This works in DJGPP, since int and long are both 32-bit, but on other > >architectures it will crash. > > Eli where did you get evidence for this affirmation? Sorry, ``crash'' was the wrong word. It just won't work as the author of this line thinks it would, if long is wider than an int.