From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10f6aa,76b1fcc14e8dced X-Google-Attributes: gid10f6aa,public X-Google-Thread: 109fba,76b1fcc14e8dced X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,c9c309a1859318a1 X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,8b6c45fbebd7d3b7 X-Google-Attributes: gid1014db,public X-Google-Thread: 114917,76b1fcc14e8dced X-Google-Attributes: gid114917,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: HELP ! need to insert value in array !! Date: 1997/07/05 Message-ID: #1/1 X-Deja-AN: 254789119 References: <33A9C27C.22F7@post4.tele.dk> <5oci49$97g@crl.crl.com> <866920621snz@genesis.demon.co.uk> <5p0v7l$9uc@nntp.seflin.org> <33b64c2f.43589878@nntp.ix.netcom.com> <5pht85$d4o$1@goanna.cs.rmit.edu.au> <33be891f.47731103@nntp.ix.netcom.com> Organization: New York University Newsgroups: comp.lang.c,comp.lang.c++,comp.os.msdos.programmer,comp.lang.asm.x86,comp.lang.ada Date: 1997-07-05T00:00:00+00:00 List-Id: Mike said <> Sure, but why do you think those instructions where there (the ones to handle odd chunk sizes). The answer is that the motivation was precisely to allow convenient support of the 7 bit format. The use of these instructions for any other size was rare. What happened was that there was a requirement for supporting the 5 char/word format in the hardware, and the designers generalized it to any byte size (rememebr this was the hey day of extravagant CISC design). Given this hardware support though, any compiler not supporting this format would have been a major menace. Really the trouble here is the lack of abstraction in the C design when it comes to arrays. Really there should be a way of saying "allocate an array of mumbles of length x", but there is no such capability, so we have to make the assumption that this length can be computed as a multiple of the element size. However, as we see, this assumption has definite shortcomings (e.g. requiring extra space to be allocated to the use of padded types in circumstances where this extra space is useless). It sure is interesting that there definitely seems to be a hole in the standard in that this requirement is not clearly stated (I would say not stated at all). This is a gap that should be addressed.