delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/08/10:06:07

Date: Thu, 8 Jan 1998 17:04:58 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Cesar Scarpini Rabak <csrabak AT dce03 DOT ipt DOT br>
cc: David Eberhard <toothpck AT xmission DOT com>, 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: <Pine.SUN.3.91.980108170400.9778C-100000@is>
MIME-Version: 1.0

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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019