Path: csiph.com!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!peer03.iad!feed-me.highwinds-media.com!peer02.am4!peer.am4.highwinds-media.com!news.highwinds-media.com!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!feeder.erje.net!2.eu.feeder.erje.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: [Solved] Need some help getting to my feet Date: Wed, 25 Apr 2018 10:48:12 -0700 Organization: None to speak of Lines: 39 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="6422cd8020e26cadac40843395f612df"; logging-data="12454"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+7wXPNn+nAqlhBRhWZoii9" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:TsVFoOXbRra0J3hLTGNlp4gLA0w= sha1:YCk4WQzl13JOmyn7ckLadGZcl8U= X-Received-Bytes: 2990 X-Received-Body-CRC: 3925056697 Xref: csiph.com comp.lang.c:129735 bartc writes: > On 25/04/2018 17:24, Keith Thompson wrote: [...] >> Schildt's use of void main() is inexcusable, not just because >> it's wrong but because it's a symptom of his technical sloppiness. > > Rather than blaming Schildt, how about blaming the compilers that allow > it? Six of my 7 C compilers will not report that as an error. Some may > be persuaded to do so, but that would require expertise beyond what a > beginner will have. I blame both, but the article I responded to was discussing Schildt. I've said before that I wish compilers (gcc in particular, since that's the one I use most often) were more strict by default, warning about obvious undefined behavior (like "void main()") and rejecting rather than merely warning about constraint violations. Of course gcc *will* warn about "void main()" if you invoke it with the right options (and the standard doesn't require a diagnostic at all). It's unfortunate that novice programmers are required to perform the extra step of learning the appropriate options. It's equally unfortunate that some more experienced programmers refuse to do so. Schildt was writing a book *about the C standard* and blatantly misrepresented what it said. > If compilers routinely rejected such things without having to be told, > rather than the other way around, I'd imagine the practice would have > died out sooner. I agree. -- 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"