Path: utzoo!mnetor!uunet!husc6!psuvax1!gondor.cs.psu.edu!schwartz From: schwartz@gondor.cs.psu.edu (Scott Schwartz) Newsgroups: comp.lang.c Subject: Re: Pascal --> C question Message-ID: <3354@psuvax1.psu.edu> Date: 11 Mar 88 18:40:35 GMT References: <650001@hpcilzb.HP.COM> <4940001@hpiacla.HP.COM> <3353@psuvax1.psu.edu> <760@cresswell.quintus.UUCP> Sender: netnews@psuvax1.psu.edu Reply-To: schwartz@gondor.cs.psu.edu (Scott Schwartz) Organization: Penn State University Lines: 23 In article <760@cresswell.quintus.UUCP> ok@quintus.UUCP (Richard A. O'Keefe) writes: >In article <3353@psuvax1.psu.edu>, schwartz@gondor.cs.psu.edu (Scott Schwartz) writes: >> So in the >> example I gave each boolean would take up one bit, and there would be >> 1024 of them, the whole array taking up 128 bytes. >The trouble is that a Pascal compiler is absolutely free to ignore >'packed' entirely. When you say > var a: array [0.1023] of boolean; >you have no guarantee at all that the compiler won't use 1024 "words". Right. Lots of (bad) compilers ignore "packed", just like some C compilers ignore "register". For the purpose of argument I was assuming a decent pascal compiler. The University of Sheffield, for example, sells a pascal compiler for Prime 50 series machines that implements "packed" down to the bit level. There's nothing like automatically taking advantage of your instruction set. Anyway, enough pascal talk. On to the next comp.lang.c topic! -- Scott Schwartz | Your array may be without head or schwartz@gondor.cs.psu.edu | tail, yet it will be proof against | defeat. -- Sun Tzu, "The Art of War"