Pascal --> C question

Scott Schwartz schwartz at gondor.cs.psu.edu
Sat Mar 12 04:40:35 AEST 1988


In article <760 at cresswell.quintus.UUCP> ok at quintus.UUCP (Richard A. O'Keefe) writes:
>In article <3353 at psuvax1.psu.edu>, schwartz at 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 at gondor.cs.psu.edu      | tail, yet it will be proof against
                                        | defeat.  -- Sun Tzu, "The Art of War"



More information about the Comp.lang.c mailing list