[comp.os.minix] "long int" bugs

tholm@uvicctr.UUCP (Terrence W. Holm) (05/05/88)

EFTH Minix report #3  - May 1988 -  long int bugs


While writing an interactive integer calculator program
(to be posted soon) we encountered three problems with
long int's.


The first is a patch to "/libc/doprintf.c". Without this
patch a printf( "%D", 0x80000000 ) does not work.
This fix is to a version containing J. P. Bunschoten's
fixes, but it is probably easiest to simply manually
apply the changes.

0a1,2
> /* Fixed "%D", 0x80000000    efth         1988-Apr-9    */
> 
153c155
< long    num;
---
> long unsigned  num;
168c170
< 		if (num < 0) {num = -num; negative++;}
---
> 		if ( (long int) num < 0) {num = -num; negative++;}



The second and third problems are to do with the code for
remainders on long int's. It seems as though the compiler
routines are correctly written, except for a label typo,
which has not been caught yet.

In "/libc/rmi4.s" there is one 'a' added:

ja L3
jb L2a				|  Changed from "jb L2"
cmp  yl(si),dx
jbe L2a
L3:


In "/libc/rmu4.s" there are two 'a's added:

ja L3
jb L2a				|  Changed from "jb L2"
cmp  yl(si),dx
jbe L2a				|  Changed from "jbe L2"
L3:


Please insert the following line at the top of each
of these two modules:

|    Fixed erroneous jump     1988-Apr-18       efth


--------------------------------------------------------------------
               Edwin L. Froese
                  uw-beaver!ubc-vision!mprg!handel!froese

               Terrence W. Holm
                  uw-beaver!uvicctr!sirius!tholm