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 10:40:14 -0800 Organization: None to speak of Lines: 35 Message-ID: References: <3fd6c360-cd60-4d22-b7c6-4ac75ab206c3@googlegroups.com> <910e144a-fbc1-43e6-a2d2-59aa44aebb72@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="d1c2f4f3e96755a2d9129a8b0bf9863b"; logging-data="2657"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/4zs9C+odCbXouIwEw9MyE" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:D5TGzolioNnYu4v7IovnXPJ9O3A= sha1:AfHg77vEGAdiP1DQWoMDD7GS0BE= Xref: csiph.com comp.lang.c:102916 supercat@casperkitty.com writes: > On Wednesday, February 1, 2017 at 9:30:23 AM UTC-6, David Brown wrote: >> How can you be writing a parser, and complaining about what C does and >> does not allow, and how other compilers match the standards, when you >> haven't even bothered to /read/ the standards? How are you making >> making your code at the moment - by skim-reading a couple of Wikipedia >> articles then some trial-and-error runs with a few existing compilers? > > The language Dennis Ritchie designed was not processed using a formal grammar, > nor is a formal grammar the most efficient way to parse that language. In > addition, I don't think a formal grammar works well as a human-readable way of > describing it either. The earliest C reference manuals, from 1974 and 1975, describe the syntax using a formal grammar, so the *language* certainly was defined that way. If you're making a claim about how Dennis Ritchie's early C compiler happened to operate, then (a) please be clear about that, and (b) I fail see the relevance. > Since some compiler-generation tools are easiest to use when they have a > formal grammar as a starting point, I think it is reasonable for the Standard > to provide a grammar and say that implementations are required to handle the > cases described by the Standard and are not required to handle cases outside > the grammar. Given the charter of the Committee, however, I really doubt that > the Committee intended that compilers should be required to reject forms that > they had accepted previously and which may be in use by production code. Compilers are not required to reject anything other than code that uses a #error directive. -- 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"