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: better atoi Date: Sun, 12 Feb 2017 11:54:32 -0800 Organization: None to speak of Lines: 47 Message-ID: References: <853138f9-54d1-435f-90d5-ef75a38e65bf@googlegroups.com> <1b1sv5k98w.fsf@pfeifferfamily.net> <874m011wzn.fsf@bsb.me.uk> <1bwpcxiaq2.fsf@pfeifferfamily.net> <87shnlx73d.fsf@bsb.me.uk> <1bbmu8isvo.fsf@pfeifferfamily.net> <877f4wy6xt.fsf@bsb.me.uk> <1blgtc5piu.fsf@pfeifferfamily.net> <87inogwd09.fsf@bsb.me.uk> <1b8tpc5gdc.fsf@pfeifferfamily.net> <01bd8443-f20c-4183-8df7-c23b93b6887b@googlegroups.com> <649395f0-f6fa-4779-b563-71527b7e677c@googlegroups.com> <491bde1c-4dc9-4c49-ab7c-496eb64f4362@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="33cadd0b020fd5cbab9e766f139f7a17"; logging-data="18604"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ckVwOf+dcab4PN5c5DLn5" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:n5EvQBoSz103xq0w2sDMOk9NZHM= sha1:37x8aY9akyWTGS5wHThb2d6ajFQ= Xref: csiph.com comp.lang.c:103757 BartC writes: > On 12/02/2017 19:15, Keith Thompson wrote: >> BartC writes: >>> On 12/02/2017 17:44, Malcolm McLean wrote: >> [...] >>>> It's useful to have a copy for reference however. Like the >>>> dictionary, 99% of it you probably won't read, but still needs to be >>>> there. >>> >>> Yes, so that most compilers can ignore it! Apparently: >>> >>> int; >>> >>> is illegal according to the grammar. Yes out of six compilers I tried, >>> three don't consider that an error, while one just gives a warning. >> >> So four out of the six compilers you tried correctly diagosed the error > > 3 didn't say anything about it (no error or warning) > 1 gave a warning > 2 gave an error > > That's one out of three that took it seriously. If a diagnostic is a non-fatal warning, then you say that the compiler doesn't consider it an error. I disagree; as has been said many times, a non-fatal warning is a valid diagnostic for an error. So 3 out of 6 correctly diagnosed the error, 2 fatally and 1 non-fatally. The other three compilers are non-conforming *in the mode in which you invoked them*. Can you make them conforming with appropriate options? > It's not the most serious error, as adding that to a program and then > having it ignored will do nothing. But that would mean you can write any > old rubbish in program. It should be diagnosed because probably > something is wrong. If you invoke a compiler *in conforming mode*, you can't get away with writting "any old rubbish". -- 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"