Sender: rich AT phekda DOT freeserve DOT co DOT uk Message-ID: <3EA5789C.F1E0CFBB@phekda.freeserve.co.uk> Date: Tue, 22 Apr 2003 18:15:08 +0100 From: Richard Dawe X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586) X-Accept-Language: de,fr MIME-Version: 1.0 To: Eric Rudd CC: andnews AT ihug DOT com DOT oz DOT au, DJGPP newsgroup Subject: Re: Bug 00314 -- div() still broken References: <3EA54F78 DOT C46438ED AT phekda DOT freeserve DOT co DOT uk> <3EA57418 DOT 2060506 AT cyberoptics DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello. Eric Rudd wrote: > > Richard Dawe wrote: > > >I'm having trouble understanding why it doesn't just do % and /. Why is > >there all this other code? > > > div() and ldiv() were originally this way as well. I don't understand > why those extra tests were ever in there, since they not only complicate > the code, but result in incorrect behavior. At some point one gives up > trying to understand why the bugs were there, and just fixes them. I thought maybe someone knew something I didn't. Like: perhaps this code gives the correct behaviour with long long, but smaller types don't need it? > Somehow lldiv() was derived from the earlier buggy div() or ldiv(), so > it also needs to be fixed in an analogous way. My postings to > djgpp-workers somehow aren't showing up there, but perhaps one of the > maintainers could take appropriate action. I'd submit a new bug report, > but this is an old bug. I haven't seen any posts to djgpp-workers. Thanks for posting to comp.os.msdos.djgpp too! > One big question for me is how div() could get fixed in the CVS tree on > 2000-07-08, but the 2.03 libc.a, dated 2001-12-24, still contained the > old, buggy div(). It appears that the 2.03 tags didn't get updated. The new 2.03 releases were made off the 2.03 maintenance branch. I can't remember the tag. It probably branches off the 2.03 release tag, which means that it wouldn't have any fixes made in CVS after the 2.03 release. > I just looked at the CVS tips, and it appears that div() and ldiv() are > correct, but lldiv() is not. Andrew added lldiv. If he agrees, I'll fix lldiv in CVS. 2.04 alpha 1 is due on the 28th April, so we should fix it before that! Thanks, bye, Rich =] -- Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]