mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 00:32:24 +00:00
added type aliasing check and warning. -- noch
This commit is contained in:
parent
de049dc80c
commit
711283cba5
2 changed files with 7 additions and 0 deletions
|
|
@ -922,6 +922,12 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *)
|
||||||
OPT.Insert(OPS.name, obj); obj^.mode := OPT.Typ; obj^.typ := OPT.undftyp;
|
OPT.Insert(OPS.name, obj); obj^.mode := OPT.Typ; obj^.typ := OPT.undftyp;
|
||||||
CheckMark(obj^.vis);
|
CheckMark(obj^.vis);
|
||||||
IF sym = OPS.eql THEN
|
IF sym = OPS.eql THEN
|
||||||
|
IF (obj^.name = "INTEGER") OR (obj^.name = "SHORTINT") OR
|
||||||
|
(obj^.name = "LONGINT") OR (obj^.name = "HUGEINT") OR
|
||||||
|
(obj^.name = "LONGREAL") OR (obj^.name = "REAL") OR
|
||||||
|
(obj^.name = "CHAR") THEN
|
||||||
|
OPM.Mark(-310, OPM.curpos); (* notice about aliasing of predefined type *)
|
||||||
|
END;
|
||||||
OPS.Get(sym); TypeDecl(obj^.typ, obj^.typ)
|
OPS.Get(sym); TypeDecl(obj^.typ, obj^.typ)
|
||||||
ELSIF (sym = OPS.becomes) OR (sym = OPS.colon) THEN
|
ELSIF (sym = OPS.becomes) OR (sym = OPS.colon) THEN
|
||||||
err(OPS.eql); OPS.Get(sym); TypeDecl(obj^.typ, obj^.typ)
|
err(OPS.eql); OPS.Get(sym); TypeDecl(obj^.typ, obj^.typ)
|
||||||
|
|
|
||||||
|
|
@ -177,6 +177,7 @@ Compiler Warnings
|
||||||
307 no ELSE symbol after CASE statement sequence may lead to trap
|
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
|
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
|
309 you should name this parameter type, or else no actual parameter will match
|
||||||
|
310 aliasing of predefined type
|
||||||
|
|
||||||
Run-time Error Messages
|
Run-time Error Messages
|
||||||
-1 assertion failed, cf. SYSTEM_assert
|
-1 assertion failed, cf. SYSTEM_assert
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue