Path: utzoo!utgpu!attcan!uunet!steinmetz!davidsen From: davidsen@steinmetz.ge.com (William E. Davidsen Jr) Newsgroups: comp.lang.c Subject: Re: Absolute size of 'short' Keywords: unsigned wrap-around Message-ID: <11794@steinmetz.ge.com> Date: 9 Aug 88 17:28:08 GMT References: <214@ISIDAPS5.UUCP> <9641@dartvax.Dartmouth.EDU> <62505@sun.uucp> <1199@ficc.UUCP> Reply-To: davidsen@crdos1.UUCP (bill davidsen) Organization: General Electric CRD, Schenectady, NY Lines: 31 In article <1199@ficc.UUCP> peter@ficc.UUCP (Peter da Silva) writes: | Not trying to start a war or anything, but how far do you really have | to stretch the language to allow: | | int a:16; I proposed something like this to X3J11 in the first year or so (I was only there two years). What I suggested was size in bytes, allowing: int foo*4 -or- int*4 foo; The feeling was that it was (a) not really needed and (b) too much like fortran. I like your idea better, but the few cases where you want exact size rather than minimum size probably don't justify inclusion. It would be nice some times to be able to specify a bit array in a struct, as in: struct bit_array { unsigned states:3[40]; }; I think that's a more likely addition, since it adds very little code to the compiler and can't be any less efficient than does it yourself in a series of unreadable shifts and ANDs. I would really like to see a "packed struct," also. This would be a struct packed on byte boundaries without fill, no matter *how bad* the code was to use them. -- bill davidsen (wedu@ge-crd.arpa) {uunet | philabs | seismo}!steinmetz!crdos1!davidsen "Stupidity, like virtue, is its own reward" -me