Article View: comp.lang.modula2
Article #607Re: Bugs in Terra's M2-Compiler V4.1-2 for VMS
From: Andreas Borchert
Date: Fri, 28 Aug 1992 12:01
Date: Fri, 28 Aug 1992 12:01
49 lines
2017 bytes
2017 bytes
In article <26AUG199217273382@srzts204>, roth@srzts204 (G.Roth, 2958,H267) writes: > A recent message asked about bugs in the Terra-Datentechnik (former Logitech) > Modula-2 compiler. > Hereafter the list of bugs we currently know: > [some bug descriptions deleted] > MODULE bug5; > > FROM SYSTEM IMPORT > SIZE; > > FROM InOut IMPORT > WriteString, WriteInt, WriteLn; > > VAR [some declarations deleted] > d : RECORD x:ARRAY [0..4] OF CHAR; END; [..deleted...] > > BEGIN [..deleted...] > WriteString( " SIZE(d) (* =5 *)" ); WriteInt( SIZE(d), 3 ); WriteLn; > WriteString( " SIZE(d.x) (* =5 *)" ); WriteInt( SIZE(d.x), 3 ); WriteLn; [..deleted...] > END bug5. > > > Comment: > SIZE() of a record type whose true length is odd and larger than 1 > returns a value that is 1 too large: > > $ modula/nolog bug5.mod > $ link bug5 > $ run bug5 [...deleted...] > SIZE(d) (* =5 *) 6 > SIZE(d.x) (* =5 *) 5 [...deleted...] That's not necessarily a bug. An implementation is free to allocate one or more bytes for padding of compositional types. It would be a bug if the compiler doesn't allocate 6 bytes for the entire RECORD type. -- _______________________________________________________________________________ Andreas Borchert, University of Ulm, SAI, D-W-7900 Ulm, Germany Internet: borchert@mathematik.uni-ulm.de
Technical Details
Message-ID:
<1992Aug28.120113.19227@informatik.uni-ulm.de>Path:
arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!darwin.sura.net!jvnc.net!yale.edu!ira.uka.de!sun1.ruf.uni-freiburg.de!news.belwue.de!theorie!titania.mathematik.uni-ulm.de!borchertReferences:
<26AUG199217273382@srzts204>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.modula2 Path: arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!darwin.sura.net!jvnc.net!yale.edu!ira.uka.de!sun1.ruf.uni-freiburg.de!news.belwue.de!theorie!titania.mathematik.uni-ulm.de!borchert From: borchert@titania.mathematik.uni-ulm.de (Andreas Borchert) Subject: Re: Bugs in Terra's M2-Compiler V4.1-2 for VMS Message-ID: <1992Aug28.120113.19227@informatik.uni-ulm.de> Sender: usenet@informatik.uni-ulm.de (Name for nntp-posting) Nntp-Posting-Host: titania.mathematik.uni-ulm.de Organization: University of Ulm, SAI References: <26AUG199217273382@srzts204> Date: Fri, 28 Aug 92 12:01:13 GMT Lines: 49