delorie.com/archives/browse.cgi | search |
X-Authentication-Warning: | delorie.com: mailnull set sender to djgpp-workers-bounces using -f |
Message-ID: | <3C817B18.4C9D1C8@yahoo.com> |
Date: | Sat, 02 Mar 2002 20:23:36 -0500 |
From: | CBFalconer <cbfalconer AT yahoo DOT com> |
Organization: | Ched Research |
X-Mailer: | Mozilla 4.75 [en] (Win98; U) |
X-Accept-Language: | en |
MIME-Version: | 1.0 |
To: | djgpp-workers AT delorie DOT com |
Subject: | Re: Malloc/free DJGPP code |
References: | <10203022206 DOT AA21057 AT clio DOT rice DOT edu> |
Reply-To: | djgpp-workers AT delorie DOT com |
Charles Sandmann wrote: > > It appears to be a warning issue (didn't build first time with warnings). > I had to cast twice to get the message to go away. Replaced > > brk((void *)( ((int)sbrk(0)+(ALIGN-1)) & ~(ALIGN-1) )); > > with > > brk((void *)( (int)((char *)sbrk(0)+(ALIGN-1)) & ~(ALIGN-1) )); > > This keeps the first cast a pointer, then I recast to integer so I > can do bit arithmetic, then cast back to make brk happy. > > Still need to do a few more tests. Sorry for the incomplete patch. My extendsbrk is always casting to unsigned char* for arith and then back to void*. I didn't assume that sbrk returns any particular pointer, and my guess is that your code assumes it is at least even. May conflict with the present method of marking free blocks, which I had to change for just that reason. -- Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT XXXXworldnet DOT att DOT net) Available for consulting/temporary embedded and systems. (Remove "XXXX" from reply address. yahoo works unmodified) mailto:uce AT ftc DOT gov (for spambots to harvest)
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |