Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Global variables Date: Sun, 06 May 2018 15:40:05 -0700 Organization: None to speak of Lines: 38 Message-ID: References: <54_FC.66716$ta2.4920@fx03.am4> <7371a825-33bc-4723-9ed7-18f23f55e76a@googlegroups.com> <66d56564-0b72-44b5-aba9-783e62eeed97@googlegroups.com> <65JHC.109059$eg.30545@fx43.am4> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="f99c42e1138a8c73b9677b033d51f90e"; logging-data="22822"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19uIS3aHVBD39LviVKKXxhC" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:9YvDyVaBWWTtdAUHlevcaCpFC7I= sha1:+XOjDuGjDyutxOdSuq0wkEFf7BQ= Xref: csiph.com comp.lang.c:130288 David Brown writes: > On 06/05/18 21:55, bartc wrote: >> On 06/05/2018 19:03, David Brown wrote: >>> On 06/05/18 15:07, bartc wrote: >> >> [Allowing () parameter lists] >> >>> Another mistake from the programmer, not the language. >> >> In my opinion it is a language mistake. If such a feature is genuinely >> needed from time to time, use (flex) for that, and perhaps change the >> meaning of () to be synonymous with (void). > > For C, backwards compatibility is key - so the meaning of "foo()" cannot > be changed to "foo(void)", as it is in C++. And C /does/ have a syntax > for declaring variadic functions, using "...". So "foo()" is never > necessary, or even useful, as far as I can see, in C89 or newer code. > > But because it /was/ necessary before, and exists in useful C source > code, it has to be supported by current compilers. It has to be supported by current compilers because the standard says so. But it's been obsolescent since 1989, and a future standard *could* remove them from the language. Backwards compatibility is important, but it's not the only criterion for deciding whether to keep a feature. Note that C99 dropped implicit int and C11 dropped gets(), both changes that broke some existing code ("broke" in the sense of making it non-conforming). [...] -- 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"