Path: csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Is this valid C? Date: Mon, 20 Feb 2017 09:17:35 -0800 Organization: None to speak of Lines: 27 Message-ID: References: <87shnab3c5.fsf@bsb.me.uk> <87wpclaoqs.fsf@bsb.me.uk> <4a1d176e-0c60-422e-9eb0-04574b2f32ef@googlegroups.com> <9e683fb3-c692-4777-8e58-6ab23eee68ff@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="9029eb194d173f90c26f49eb1843bbfe"; logging-data="9995"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/TqiQwtQL3S9DRPR1FwGX0" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:a8g15FrYtHNesQH8kQV6z0+XnG4= sha1:ceQ8aoA9Jf1m4aZLwwqhMxA/6/U= Xref: csiph.com comp.lang.c:104274 supercat@casperkitty.com writes: > On Monday, February 20, 2017 at 10:03:09 AM UTC-6, Bart wrote: >> Adding general bit and bitfield types into the type system would be >> quite a heavy feature I think, and would require bit and bitfield pointers. > > It would be a heavy feature to *mandate*. Some processors, however, do have > instructions which accept an address in one register, a sub-word index in > another, and can easily load or store a value from a portion of a word, and > it would seem useful to have a standard syntax which, if accepted, would have > a consistent meaning. Even if all implementations supported it, there would > likely be some where it was used often and some where it never got used, so > allowing implementers to support it or not based upon customer requirements > would seem better than mandating support everywhere. Great. That's exactly the current situation. Implementations are free to support general bit and bitfield types *as an extension*. They can even collaborate to settle on consistent syntax and semantics, and perhaps document it as a secondary standard. There's no particular need to change the C stndaard itself. [...] -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"