Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Abstract Syntax Tree for C programs Date: Mon, 27 May 2019 18:12:14 -0700 Organization: None to speak of Lines: 42 Message-ID: References: <1727e4f9-2056-4357-8572-599c46db6a88@googlegroups.com> <17344bb7-9c96-47eb-b006-c6c2e2b8bc59@googlegroups.com> <97b08cce-ec5d-4052-9338-0026b5d449bf@googlegroups.com> <87sgt339na.fsf@bsb.me.uk> <80470a36-78de-417f-bc75-a7966c87b31e@googlegroups.com> <9cbcea67-85a8-4de3-ac01-04922ba5fc74@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="96c016763d4b95fce0489d64fdbdb2d7"; logging-data="31913"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX181J0gKOubFFfqevtqNZf4r" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:r1GsCvBWDCN57b9L+yCk/zxL158= sha1:Ei74RQMxd/DQ9RYLLQilJDdabsE= Xref: csiph.com comp.lang.c:144051 Bart writes: > On 27/05/2019 21:23, James Kuyper wrote: [...] >> No, at the time I wrote my message, I hadn't. I've had to take care of >> my 4-year old twins for the last four days without my wife's help - I >> didn't have time for anything else. However, I just tried it with >> gcc -std=C11 -pedantic, and got precisely the diagnostics that are >> mandatory for that syntax error. > > If they are mandatory, then why do you need '-pedantic'? I'll explain it again. Please tell us which part or parts of this you didn't already know. 1. A diagnostic for an extra semicolon at file scope is mandatory for any conforming C compiler. (Perhaps you only learned this recently, but you should certainly be aware of it now.) 2. gcc without "-pedantic" is not a conforming C compiler. That's why it doesn't warn about it. 3. gcc with "-pedantic" attempts to be a conforming C compiler. It issues a warning for an extra semicolon at file scope. 4. A non-fatal warning qualifies as a diagnostic message as far as the C standard is concerned. 5. It happens that "-pedantic" by itself is enough to enable this particular required diagnostic. Using "-std=c11" in addition to "-pedantic" may be necessary to enable some other diagnostics. Again, most or all of these points have been explained directly to you multiple times in this newsgroup. Your question could imply that you were unaware of at least some of them. If your only response is that you don't care, please don't reply at all. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Will write code for food. void Void(void) { Void(); } /* The recursive call of the void */