Path: csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: function declaration without args no longer works
Date: Wed, 29 Apr 2026 16:32:51 -0700
Organization: A noiseless patient Spider
Lines: 63
Message-ID: <86bjf11gws.fsf@linuxsc.com>
References: <10sl5na$5ov$1@reader1.panix.com> <20260426175044.000062ff@yahoo.com> <10slf3h$mho$3@reader1.panix.com> <10smamp$1vlj2$2@dont-email.me> <10smvq5$25a7q$2@dont-email.me> <10spm2q$5fq$1@reader1.panix.com> <10spqdr$2vs2g$1@dont-email.me> <10ss83f$c4t$1@reader1.panix.com> <10ssb73$3mum2$1@dont-email.me> <20260429112553.00006835@yahoo.com> <10ssl5f$3qhoh$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Wed, 29 Apr 2026 23:32:52 +0000 (UTC)
Injection-Info: dont-email.me; posting-host="43c851be6dd2938b63d54cae32dcc1b4"; logging-data="303263"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/7qRA7zTvOF2t0TuM+gYaCLUorDcCkvbw="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:V6pWguQgT7ezlspANT+DghRHUMQ= sha1:Cc6vO/SC4KDiUya3iBqHS0iEkvM=
Xref: csiph.com comp.lang.c:398099
Bart writes:
> On 29/04/2026 09:25, Michael S wrote:
>
>> On Wed, 29 Apr 2026 09:15:47 +0200
>> David Brown wrote:
>>
>>> Other people have been using function prototypes for the last 30
>>> years of C programming. You don't need to be working in a vacuum to
>>> see C99 code. And while consistency of coding style and standard
>>> level is absolutely an important consideration when maintaining or
>>> modifying existing code, it is a /consideration/ - not an absolute.
>>> If I am making small changes to a piece of old C90 code, I'll use
>>> C90, but if I am spending a lot of time working on a big
>>> modification, and there are no other overriding requirements, I'll
>>> write the new stuff in a better style.
>>>
>>>> But the world I see is full of pre-existing
>>>> complications that frequently can't be precisely predicted, and
>>>> that often can affect your choice of coding style. Better to be
>>>> conservative and safe than flamboyant and sorry. (Not saying
>>>> your suggestions are flamboyant, but the sentence sounded
>>>> cuter that way:)
>>>
>>> Modern C lets you write better C - clearer, safer, more efficient.
>>> C90 is "conservative and safe" compared to C99 in the same way that
>>> cars from the 1950's are "conservative and safe" compared to modern
>>> designs.
>>>
>>> (Of course you can write good C90 and bad C99 - it's the driver that
>>> makes the biggest difference to safety.)
>>
>> The text above sound as if function prototypes were invented for C99.
>> Of course, they are not.
>>
>> In practice there are only 3 features that make difference between C90
>> and C99 for majority of coders and all three are "nice to have" rather
>> than make a major difference.
>> 1. // comments
>> 2. declaration does not have to be at the beginning of {} block
>> 3. 'long long' integer types and
>
> 4. Anonymous unions and structs within a struct definition:
>
> struct {
> int a;
> union {
> int b;
> int c;
> int d;
> struct {
> int e;
> int f;
> };
> };
> int g;
> } x;
>
> Here, I can write x.a, x.c, x.e, instead of needing x.a, x.u.c,
> x.u.s.e etc when the nested union and struct are named u and s
> respectively.
Anonymous structs and unions were added in C11, not C99.