home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / modula2 / 1060 < prev    next >
Encoding:
Text File  |  1992-08-26  |  7.7 KB  |  320 lines

  1. Newsgroups: comp.lang.modula2
  2. Path: sparky!uunet!wupost!darwin.sura.net!Sirius.dfn.de!ira.uka.de!chx400!srzts100.alcatel.ch!srzts204!roth
  3. From: roth@srzts204 (G.Roth, 2958,H267)
  4. Subject: Bugs in Terra's M2-Compiler V4.1-2 for VMS
  5. Message-ID: <26AUG199217273382@srzts204>
  6. News-Software: VAX/VMS VNEWS 1.41    
  7. Sender: news@srzts100.alcatel.ch (USENET News System)
  8. Organization: Alcatel STR AG Switzerland
  9. Date: Wed, 26 Aug 1992 16:27:00 GMT
  10. Lines: 308
  11.  
  12. A recent message asked about bugs in the Terra-Datentechnik (former Logitech)
  13. Modula-2 compiler.
  14. Hereafter the list of bugs we currently know:
  15.  
  16. ===============================================================================
  17.  
  18. MODULE bug1;
  19.  
  20. PROCEDURE P( a,b : INTEGER );
  21. END P;
  22.  
  23. BEGIN
  24.   P( 1, 2, );
  25. END bug1.
  26.  
  27.  
  28. Comment:
  29.     A comma after the last valid parameter crashes the compiler.
  30.  
  31. $ modula/log=(all,noquali) bug1.mod
  32. TERRA Datentechnik MODULA-2/VMS V4.1-2, October 89
  33. (C) LOGITECH 1985 - 1989, TERRA 1989
  34. Compiling STR_BK_TAV:[TAV.B_RUESS]BUG1.MOD;1
  35. Syntax analysis
  36. Declaration analysis
  37. Body analysis
  38. Code generation
  39. %M2VMS-F-ASSFAIL, compiler error (assertion failed)
  40.  
  41.  
  42. ===============================================================================
  43.  
  44. DEFINITION MODULE bug2_1;
  45.  
  46. EXPORT QUALIFIED
  47.   Opaq;
  48.  
  49. TYPE
  50.   Opaq;
  51.  
  52. END bug2_1.
  53.  
  54.  
  55. MODULE bug2;
  56.  
  57. FROM bug2_1 IMPORT 
  58.   Opaq;
  59.  
  60. VAR
  61.  q1,q2 : Opaq;
  62.  
  63. BEGIN
  64.   IF q1=q2 THEN END;
  65. END bug2.
  66.  
  67.  
  68. Comment:
  69.  
  70.     According to N.Wirth "Programming in Modula-2" the operations :=, =
  71.     and # are defined and admissable for opaque types. But the compiler
  72.     is giving an error message:
  73.  
  74. $ modula/log=(all,noquali) bug2_1.def
  75. TERRA Datentechnik MODULA-2/VMS V4.1-2, October 89
  76. (C) LOGITECH 1985 - 1989, TERRA 1989
  77. Compiling STR_BK_TAV:[TAV.B_RUESS]BUG2_1.DEF;2
  78. Syntax analysis
  79. Declaration analysis
  80. Symbol file generation
  81. End of compilation
  82. $
  83. $ modula/log=(all,noquali) bug2.mod
  84. TERRA Datentechnik MODULA-2/VMS V4.1-2, October 89
  85. (C) LOGITECH 1985 - 1989, TERRA 1989
  86. Compiling STR_BK_TAV:[TAV.B_RUESS]BUG2.MOD;2
  87. Syntax analysis
  88.  bug2_1: STR_BK_TAV:[TAV.B_RUESS]BUG2_1.SYM;1
  89. Declaration analysis
  90. Body analysis
  91.  ---- error
  92. Error messages
  93.    10      IF q1=q2 THEN END;
  94. %M2VMS,          ^ operation with incompatible type
  95. End of compilation
  96. %M2VMS-F-ENDERR, Modula completed with ERRORS detected
  97.  
  98.  
  99. ===============================================================================
  100.  
  101. MODULE bug3;
  102.  
  103. FROM SYSTEM IMPORT
  104.   QUADWORD;
  105.  
  106. PROCEDURE P( s : QUADWORD );
  107. END P;
  108.  
  109. PROCEDURE Q( a : ARRAY OF CHAR );
  110. BEGIN
  111.   P( a );
  112. END Q;
  113.  
  114. END bug3.
  115.  
  116.  
  117. Comment:
  118.  
  119.     This program gets compiled WITHOUT error message though there is a
  120.     type conflict at the call of P (the actual parameter is of type
  121.     ARRAY OF CHAR while the formal type is of type QUADWORD)
  122.  
  123. $ modula/log=(all,noquali) bug3.mod
  124. TERRA Datentechnik MODULA-2/VMS V4.1-2, October 89
  125. (C) LOGITECH 1985 - 1989, TERRA 1989
  126. Compiling STR_BK_TAV:[TAV.B_RUESS]BUG3.MOD;1
  127. Syntax analysis
  128. Declaration analysis
  129. Body analysis
  130. Code generation
  131. End of compilation
  132.  
  133.  
  134. ===============================================================================
  135.  
  136. MODULE bug4;
  137.  
  138. TYPE
  139.   Enum=(en1,en2,en3,en4,en5);
  140.  
  141. VAR
  142.   e : Enum;
  143.  
  144. BEGIN
  145.   e := MIN(Enum);
  146.   e := MAX(Enum);
  147. END bug4.
  148.  
  149.  
  150. Comment:
  151.  
  152.     The compiler sees MIN(Enum) and MAX(Enum) as incompatible to e.
  153.  
  154. $ modula/log=(all,noquali) bug4.mod
  155. TERRA Datentechnik MODULA-2/VMS V4.1-2, October 89
  156. (C) LOGITECH 1985 - 1989, TERRA 1989
  157. Compiling STR_BK_TAV:[TAV.B_RUESS]BUG4.MOD;1
  158. Syntax analysis
  159. Declaration analysis
  160. Body analysis
  161.  ---- error
  162. Error messages
  163.    10      e := MIN(Enum);
  164. %M2VMS,   ^ type incompatibility
  165.    11      e := MAX(Enum);
  166. %M2VMS,   ^ type incompatibility
  167. End of compilation
  168. %M2VMS-F-ENDERR, Modula completed with ERRORS detected
  169.  
  170. ===============================================================================
  171.  
  172. MODULE bug5;
  173.  
  174. FROM SYSTEM IMPORT
  175.   SIZE;
  176.  
  177. FROM InOut IMPORT
  178.   WriteString, WriteInt, WriteLn;
  179.  
  180. VAR
  181.   a : ARRAY [0..3] OF CHAR;
  182.   b : ARRAY [0..4] OF CHAR;
  183.   c : RECORD x:ARRAY [0..3] OF CHAR; END;
  184.   d : RECORD x:ARRAY [0..4] OF CHAR; END;
  185.   e : RECORD x:CHAR; END;
  186.   f : RECORD x,y:CHAR; END;
  187.   g : RECORD x,y,z:CHAR; END;
  188.  
  189. BEGIN
  190.   WriteString( "  SIZE(a)   (* =4 *)" ); WriteInt( SIZE(a),   3 ); WriteLn;
  191.   WriteString( "  SIZE(b)   (* =5 *)" ); WriteInt( SIZE(b),   3 ); WriteLn;
  192.   WriteLn;
  193.   WriteString( "  SIZE(c)   (* =4 *)" ); WriteInt( SIZE(c),   3 ); WriteLn;
  194.   WriteString( "  SIZE(c.x) (* =4 *)" ); WriteInt( SIZE(c.x), 3 ); WriteLn;
  195.   WriteString( "  SIZE(d)   (* =5 *)" ); WriteInt( SIZE(d),   3 ); WriteLn;
  196.   WriteString( "  SIZE(d.x) (* =5 *)" ); WriteInt( SIZE(d.x), 3 ); WriteLn;
  197.   WriteLn;
  198.   WriteString( "  SIZE(e)   (* =1 *)" ); WriteInt( SIZE(e),   3 ); WriteLn;
  199.   WriteString( "  SIZE(e.x) (* =1 *)" ); WriteInt( SIZE(e.x), 3 ); WriteLn;
  200.   WriteString( "  SIZE(f)   (* =2 *)" ); WriteInt( SIZE(f),   3 ); WriteLn;
  201.   WriteString( "  SIZE(f.x) (* =1 *)" ); WriteInt( SIZE(f.x), 3 ); WriteLn;
  202.   WriteString( "  SIZE(g)   (* =3 *)" ); WriteInt( SIZE(g),   3 ); WriteLn;
  203.   WriteString( "  SIZE(g.x) (* =1 *)" ); WriteInt( SIZE(g.x), 3 ); WriteLn;
  204. END bug5.
  205.  
  206.  
  207. Comment:
  208.     SIZE() of a record type whose true length is odd and larger than 1
  209.     returns a value that is 1 too large:
  210.  
  211. $ modula/nolog bug5.mod
  212. $ link bug5
  213. $ run bug5
  214.   SIZE(a)   (* =4 *)  4
  215.   SIZE(b)   (* =5 *)  5
  216.  
  217.   SIZE(c)   (* =4 *)  4
  218.   SIZE(c.x) (* =4 *)  4
  219.   SIZE(d)   (* =5 *)  6
  220.   SIZE(d.x) (* =5 *)  5
  221.  
  222.   SIZE(e)   (* =1 *)  1
  223.   SIZE(e.x) (* =1 *)  1
  224.   SIZE(f)   (* =2 *)  2
  225.   SIZE(f.x) (* =1 *)  1
  226.   SIZE(g)   (* =3 *)  4
  227.   SIZE(g.x) (* =1 *)  1
  228.  
  229. ===============================================================================
  230.  
  231. MODULE bug6;
  232.  
  233. FROM bug6_1 IMPORT 
  234.   xyz;
  235.  
  236. BEGIN
  237. END bug6.
  238.  
  239.  
  240. Comment:
  241.     If the definition file is not yet compiled, the compiler exactly
  242.     states this fact; In the diagnostic file (used for LSE) however,
  243.     there is a incomprehensible message which does not tell the true fault.
  244.  
  245. $ modula/log=(all,noquali)/diag bug6.mod
  246. TERRA Datentechnik MODULA-2/VMS V4.1-2, October 89
  247. (C) LOGITECH 1985 - 1989, TERRA 1989
  248. Compiling STR_BK_TAV:[TAV.B_RUESS]BUG6.MOD;1
  249. Syntax analysis
  250.  bug6_1:   ---- no file found
  251.  ---- error
  252. %M2VMS-E-MISSYM, symbol files missing
  253. End of compilation
  254. %M2VMS-F-ENDERR, Modula completed with ERRORS detected
  255. $
  256. $ type bug6.dia
  257.  
  258. START MODULE
  259. !
  260. START DIAGNOSTIC
  261. REGION/FILE/PRIMARY/LINE=6/COLUMN=(5)  STR_BK_TAV:[TAV.B_RUESS]BUG6.MOD;1
  262. MESSAGE/TEXT=QUOTED "%M2VMS-E-POINTEXP, '.' expected"
  263. END DIAGNOSTIC
  264. !
  265. START DIAGNOSTIC
  266. REGION/FILE/PRIMARY/LINE=1/COLUMN=(1)  STR_BK_TAV:[TAV.B_RUESS]BUG6.MOD;1
  267. MESSAGE/TEXT=QUOTED "%NONAME-E-NOMSG, Message number 480D9652"
  268. END DIAGNOSTIC
  269. !
  270. END MODULE
  271.  
  272. ===============================================================================
  273.  
  274. DEFINITION MODULE bug7_1;
  275.  
  276. EXPORT QUALIFIED
  277.   aaa,
  278.   xyz;
  279.  
  280. TYPE
  281.   aaa;
  282.  
  283. END bug7_1.
  284.  
  285.  
  286. Comment:
  287.     If not all exported identifiers are declared in the definition
  288.     module, the diagnostic file does not contain information about
  289.     the missing identifier.
  290.  
  291. $ modula/log=(all,noquali)/diag bug7_1.def
  292. TERRA Datentechnik MODULA-2/VMS V4.1-2, October 89
  293. (C) LOGITECH 1985 - 1989, TERRA 1989
  294. Compiling STR_BK_TAV:[TAV.B_RUESS]BUG7_1.DEF;1
  295. Syntax analysis
  296. Declaration analysis
  297.  ---- error
  298. Error messages
  299.    10    END bug7_1.
  300. %M2VMS,   ^ undeclared identifier in export-list of the module \xyz\
  301. End of compilation
  302. %M2VMS-F-ENDERR, Modula completed with ERRORS detected
  303. $
  304. $ type bug7_1.dia
  305.  
  306. START MODULE
  307. !
  308. START DIAGNOSTIC
  309. REGION/FILE/PRIMARY/LINE=10/COLUMN=(3)  STR_BK_TAV:[TAV.B_RUESS]BUG7_1.DEF;1
  310. MESSAGE/TEXT=QUOTED "%M2VMS-E-UNDECID, undeclared identifier in export-list of the module"
  311. END DIAGNOSTIC
  312. !
  313. END MODULE
  314.  
  315.  
  316. Guido Roth (3.941)   | Tel: +41-1-465 2958                 Fax: +41-1-465 3525 |
  317. Alcatel STR AG       | INTERNET: guido.roth@alcatel.ch                         |
  318. Friesenbergstr. 75   | X.25:     PSI%4795123920::ROTH                          |
  319. CH 8055 Zurich       | X.400:    C=ch ADMD=arcom PRMD=alcatel S=roth G=guido   |
  320.