Doc updates. Add warning for anonymous ARAY or RECORD parameter types.

This commit is contained in:
David Brown 2016-11-24 12:49:59 +00:00
parent 036b8eef41
commit 1c137d2d7a
10 changed files with 405 additions and 157 deletions

View file

@ -68,7 +68,6 @@ MODULE Compiler; (* J. Templ 3.2.95 *)
OPT.intobj.typ := OPT.inttyp;
OPT.lintobj.typ := OPT.linttyp;
(*OPT.settyp.size := OPM.SetSize;*)
CASE OPM.LongintSize OF
|4: OPT.settyp := OPT.set32typ
ELSE OPT.settyp := OPT.set64typ

View file

@ -92,7 +92,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *)
GlobalAlignment, Alignment*: INTEGER;
GlobalOptions*, Options*: SET;
ShortintSize*, IntegerSize*, LongintSize*, SetSize*: INTEGER;
ShortintSize*, IntegerSize*, LongintSize*: INTEGER;
MaxIndex*: SYSTEM.INT64;
@ -214,13 +214,7 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *)
ASSERT((IntegerSize = 2) OR (IntegerSize = 4));
ASSERT((AddressSize = 4) OR (AddressSize = 8));
ASSERT((Alignment = 4) OR (Alignment = 8));
IF IntegerSize = 2 THEN
LongintSize := 4;
SetSize := 4;
ELSE
LongintSize := 8;
SetSize := 8;
END;
IF IntegerSize = 2 THEN LongintSize := 4 ELSE LongintSize := 8 END;
Files.SetSearchPath("")
ELSE
LogWStr(" warning: option ");
@ -317,11 +311,11 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *)
BEGIN
LogWLn;
LogWStr("Type Size"); LogWLn;
LogWStr("SHORTINT "); LogWNum(ShortintSize, 4); (* LogWNum(SIntAlign, 5); *) LogWLn;
LogWStr("INTEGER "); LogWNum(IntegerSize, 4); (* LogWNum(IntAlign, 5); *) LogWLn;
LogWStr("LONGINT "); LogWNum(LongintSize, 4); (* LogWNum(LIntAlign, 5); *) LogWLn;
LogWStr("SET "); LogWNum(SetSize, 4); (* LogWNum(SetAlign, 5); *) LogWLn;
LogWStr("ADDRESS "); LogWNum(AddressSize, 4); (* LogWNum(PointerAlign, 5); *) LogWLn;
LogWStr("SHORTINT "); LogWNum(ShortintSize, 4); LogWLn;
LogWStr("INTEGER "); LogWNum(IntegerSize, 4); LogWLn;
LogWStr("LONGINT "); LogWNum(LongintSize, 4); LogWLn;
LogWStr("SET "); LogWNum(LongintSize, 4); LogWLn;
LogWStr("ADDRESS "); LogWNum(AddressSize, 4); LogWLn;
LogWLn;
LogWStr("Alignment: "); LogWNum(Alignment, 4); LogWLn;
END VerboseListSizes;
@ -344,10 +338,10 @@ MODULE OPM; (* RC 6.3.89 / 28.6.89, J.Templ 10.7.89 / 22.7.96 *)
MaxIndex := SignedMaximum(AddressSize);
CASE Model[0] OF
|'2': ShortintSize := 1; IntegerSize := 2; LongintSize := 4; SetSize := 4
|'C': ShortintSize := 2; IntegerSize := 4; LongintSize := 8; SetSize := 8
|'V': ShortintSize := 1; IntegerSize := 4; LongintSize := 8; SetSize := 8
ELSE ShortintSize := 1; IntegerSize := 2; LongintSize := 4; SetSize := 4
|'2': ShortintSize := 1; IntegerSize := 2; LongintSize := 4
|'C': ShortintSize := 2; IntegerSize := 4; LongintSize := 8
|'V': ShortintSize := 1; IntegerSize := 4; LongintSize := 8
ELSE ShortintSize := 1; IntegerSize := 2; LongintSize := 4
END;
IF verbose IN Options THEN VerboseListSizes END;

View file

@ -218,6 +218,12 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *)
END
END ;
CheckSym(OPS.colon); Type(typ, OPT.notyp);
IF ((typ.comp = OPT.Array) OR (typ.comp = OPT.Record))
& (typ.strobj = NIL) THEN
err(-309)
END;
IF mode = OPT.Var THEN typ^.pvused := TRUE END ;
(* typ^.pbused is set when parameter type name is parsed *)
WHILE first # NIL DO first^.typ := typ; first := first^.link END ;

View file

@ -1327,10 +1327,10 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0;
EnterProc("NEW", sysnewfn);
EnterProc("MOVE", movefn);
syslink := topScope^.right;
universe := topScope; topScope^.right := NIL;
EnterTyp("BOOLEAN", Bool, 1, booltyp);
EnterTyp("CHAR", Char, 1, chartyp);
EnterTyp("REAL", Real, 4, realtyp);
@ -1338,6 +1338,7 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0;
EnterTyp("HUGEINT", Int, 8, hinttyp);
EnterTyp("BYTE@", Int, 1, cpbytetyp); (* Component Pascal byte type, enabled in Compiler.PropagateElementaryTypeSize *)
(* Type aliases for standard integer and set types are linked to real types in Compiler.PropagateElementaryTypeSize *)
EnterTypeAlias("SHORTINT", sintobj);
EnterTypeAlias("INTEGER", intobj);
EnterTypeAlias("LONGINT", lintobj);

View file

@ -176,6 +176,7 @@ Compiler Warnings
306 inappropriate symbol file ignored
307 no ELSE symbol after CASE statement sequence may lead to trap
308 SYSTEM.VAL result includes memory past end of source variable; use SYSTEM.GET
309 you should name this parameter type, or else no actual parameter will match
Run-time Error Messages
-1 assertion failed, cf. SYSTEM_assert

View file

@ -11,8 +11,6 @@
#define O_VER 1.95 // Version number to be reported by compiler.
#define O_NAME voc // Compiler name used for binary, install dir and references in text.
// #define LARGE // Define this to get 32 bit INTEGER and 64 bit longints even on 32 bit platforms.
#include "SYSTEM.h"