Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: C declarations Date: Wed, 01 Feb 2017 08:15:13 -0800 Organization: None to speak of Lines: 26 Message-ID: References: <3fd6c360-cd60-4d22-b7c6-4ac75ab206c3@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="d1c2f4f3e96755a2d9129a8b0bf9863b"; logging-data="641"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/gdULaBFmNXFuZYz9NWJ28" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:PboauIPaiCpoLeQbtBTOCv66a/Q= sha1:4y+lFVdrSdDFUePxwe9MdwilFLM= Xref: csiph.com comp.lang.c:102909 David Brown writes: [...] > But that has nothing to do with the fact that the standards committee > decided to specify the syntax of the language using a combination of BNF > and some constraints, rather than making a significantly more complex > BNF grammar. The constraints for type specifiers could, I believe, have > been expressed in BNF - but doing so would make it harder to understand. Expressing those constraints in BNF would have been tedious and would have made the grammar substantially larger. The type "unsigned long" can also be written as "long unsigned", and there is code that depends on that. Rather than permitting only the commonly used orders (whatever they are), the standard allows any order. A BNF grammar that permits `long unsigned int long` but forbids `int unsigned int long` would be unwieldy, especially when other keywords like const can legally be interspersed. It probably would have been better to have a more restrictive grammar from the beginning, but that wasn't practical. -- 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"