MCS - Compiler version 4.4.6 ---------------------------- BUG : Segmentation Fault due to the affectation of the 7th parameter. BUG2: Global variable value changed due to coroutines. BUG3: Segmentation Fault ( W[0*k] := 0.0 ) . BUG4: Values of LongReals modified through access to LRealToStr. BUG5: Values of LongReals modified through access to LRealToStr. We transform a string S into a longreal and back in a string S1, and we get the following results: S = "987654321.12345" and S1 = "987654405.48863" MCS - Compiler version 4.5.0 ---------------------------- BUG : Runs without any problems. (No segmentation fault) BUG2: Runs without any problems. BUG3: Runs without any problems. (No segmentation fault) BUG4: Runs without any problems. BUG5: Same results as version 4.4.6. MCS - Compiler version 4.5.0 with NEW ConLReal (C Library) ---------------------------------------------------------- BUG5: With the use of C functions, it runs without any problems. Here is the list of the different programs/bugs encountered : (******************* More then 6 parameters ********************************) MODULE BUG; IMPORT Terminal; VAR A, B, C, D, E, F, G : LONGREAL; PROCEDURE StatKS ( P1, P2, P3, P4: LONGREAL; VAR P5 : LONGREAL; VAR P6 : LONGREAL; VAR P7 : LONGREAL ); BEGIN P5 := 0.0; P6 := 0.0; P7 := 0.0; (* This affectation causes a segmentation fault *) Terminal.WriteString("Doesn't get Here!"); Terminal.WriteLn; END StatKS; BEGIN StatKS (A, B, C, D, E, F, G); END BUG. (*************************** Coroutines ***********************************) MODULE BUG2; FROM COROUTINES IMPORT NEWCOROUTINE, TRANSFER, COROUTINE, SELF; FROM StdIO IMPORT Write, NL; FROM SYSTEM IMPORT ADR, LOC; FROM realinout IMPORT WriteReal; VAR a, b : COROUTINE; wa,wb : ARRAY[0..2047] OF LOC; i : INTEGER; Z : LONGREAL; N : LONGINT ; PROCEDURE coa; (* N.B.: SaveZ will be affected. If the next line becomes: *) (* VAR *) (* TempZ, SaveZ : LONGREAL; then TempZ will be affected. *) VAR SaveZ, TempZ : LONGREAL; BEGIN Write("s", "Main coroutine actived"); NL; N := 0; TRANSFER (b); Z := LFLOAT (N); SaveZ := Z; TempZ := Z; WriteReal (SaveZ, 15); NL; WriteReal (TempZ, 15); NL; N := 0; TRANSFER (b); WriteReal (SaveZ, 15); NL; WriteReal (TempZ, 15); NL; END coa; PROCEDURE cob; VAR S : LONGREAL; BEGIN Write("s", "2nd coroutine activated"); NL; INC (N); S := 15.0 ; TRANSFER (a); INC (N); S := 3.8275; TRANSFER (a); END cob; PROCEDURE test; BEGIN NEWCOROUTINE (coa, ADR(wa), SIZE(wa), INTERRUPTIBLE, a); NEWCOROUTINE (cob, ADR(wb), SIZE(wb), INTERRUPTIBLE, b); TRANSFER (a); END test; BEGIN test; END BUG2. (********************* Assignation (0*k) **********************************) MODULE BUG3; FROM StdIO IMPORT Write, NL; FROM realinout IMPORT WriteReal; VAR i, j, k : INTEGER; W : ARRAY [0..5] OF LONGREAL; BEGIN k := 25; FOR i := 0 TO 5 DO W[i] := 3.25; Write("s", "Value of W["); Write("i", i); Write("s", "] = "); WriteReal(W[i],9); NL; END; W[0 * k] := 0.0; (* This causes a segmentation fault *) (* W[0] := 0.0; *) (* This is OK *) FOR i := 0 TO 5 DO Write("s", "Value of W["); Write("i", i); Write("s", "] = "); WriteReal(W[i],9); NL; END; END BUG3. (****************** Conversion of LongReals to Strings **************) MODULE BUG4; FROM ConLReal IMPORT LRealToStr; FROM StdIO IMPORT Write, NL; VAR DemiX, Temp : LONGREAL; S : ARRAY [0..20] OF CHAR; BEGIN DemiX := 14.6880000000000 ; Write ("s", "Value of DemiX = "); LRealToStr (DemiX, 13, S); Write ("s", S); NL; Write ("s", "Value of -DemiX = "); LRealToStr (-DemiX, 13, S); Write ("s", S); NL; Temp := -DemiX; Write ("s", "Value of Temp = "); LRealToStr (Temp, 13, S); Write ("s", S); NL; END BUG4. (****************** Conversion of Longreals to Strings **************) MODULE BUG5; FROM StdIO IMPORT Write, NL; FROM FileIO IMPORT StdOut; FROM ETextIO IMPORT FWriteCh; FROM realinout IMPORT WriteReal; FROM ConLReal IMPORT StrToLReal, LRealToStr; CONST S = "987654321.12345"; VAR i : LONGINT; W : LONGREAL; OK : BOOLEAN; S1 : ARRAY [1..20] OF CHAR; BEGIN StrToLReal (S, W,OK); LRealToStr (W, 10, S1); FOR i:=1 TO 20 DO FWriteCh (StdOut, S1[i]) END;NL; END BUG5. (********************************)