Path: utzoo!attcan!uunet!mcvax!hp4nl!ruuinf!piet From: piet@ruuinf (Piet van Oostrum) Newsgroups: comp.lang.modula2 Subject: Re: C++ vs. Modula2 Message-ID: <981@ruuinf.UUCP> Date: 16 Jan 89 08:54:26 GMT References: Sender: piet@ruuinf.UUCP Reply-To: piet@ruuinf (Piet van Oostrum) Organization: Dept of Computer Science, University of Utrecht, Holland Lines: 38 In-reply-to: alk@UX.ACSS.UMN.EDU In article , alk@UX writes: `As was recently observed in the info-pascal mailing list, optimization -> `conditional compilation. Consider: ` . ` : ` CONST ` . ` : ` OpSys = VMS; ` . ` : ` IF OpSys = VMS THEN ` DoVMSStuff ` ELSE ` DoOtherOSStuff; ` . ` : ` `All but the most inanely STUPID of compilers will completely eliminate the `unreachable code. This only helps for statements, not for declarations. ` `>Allocation of space for records (particularily alignment) is unclear in Modula. `>Operating system calls frequently return pointers to records with some `>operating system defined layout. Mapping these on Modula records is, due to `>alignment, compiler dependent. This is also true for C. I had a problem recently on our HCX/UX system where the compiler insists on aligning a lot, and where this gave problems in one of the COFF format structs, that have a long word not aligned on a four-byte boundary. I could get along with hacking a short in front of it and reading/writing the second to last fields. -- Piet van Oostrum, Dept of Computer Science, University of Utrecht Padualaan 14, P.O. Box 80.089, 3508 TB Utrecht, The Netherlands Telephone: +31-30-531806. piet@cs.ruu.nl (mcvax!hp4nl!ruuinf!piet)